doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
18 stars 20 forks source link

[Bug] set data into a hidden column #24

Closed darkomenx closed 4 months ago

darkomenx commented 5 months ago

Hello doonfrs,

I would like to implement features : hidden/display dynamically children row of another specific row.

I base my implementation of this example of official repo : add remove row column

In particular of this function : handleAddRows() which works with e.cells['status']!.value for settings value of the new rows.

BUT (issue) : My grid has a hidden defined Column that is not present on e.cells collection (provided by (_stateManager!.getNewRows()). This is a issue because when those rows are injected into the grid the hidden column is mandatory and it generate error on each row because I hadn't filled the cells.

QUESTION : How can I set data of the hidden column dynamically ? Is there another trick for doing this ? Is this a real issue ?

Technical context : OS : windows 11 Dart : 3.3.0 Flutter : 3.19.1 (channel stable) pluto_grid_plus : 8.3.0

Thank you for your support.

doonfrs commented 4 months ago

Hi @darkomenx Maybe you can add an empty value in cells maps, I don't know if it is good for the grid to ignore not found cell field, the exception is a sign of something missing in the data and this is the default behavior, so you can do this workaround by filling an empty value, it should work.