The default behavior of the NG Grid is that we provide a dataprovider per column. Hence each row is one record from within the database.
Is there anyway of having a type of ‘blank’ grid where I can give each cell of the grid it’s own dataprovider?
For example, creating a 7x6 grid and every cell is a different dataprovider…
you can’t do that with NG Grids, but why would you want to use a table component in this case? Can’t you just use
dedicated label/text field components for each cell?
Hi John,
To add to what Gabi says, this is not supported because Servoy grids (NG Grid and Table Component) are data-bound, so each row corresponding to a record in a data source.
Another approach could be to create an in-mem data source, populate with several empty records and bind that data source to a regular grid. Then when the user edits/saves, you transpose it back to your “real” data source. Would be a bit cumbersome, but you would get the desired effect in the UI.
Gabi Boros:
you can’t do that with NG Grids, but why would you want to use a table component in this case? Can’t you just use
dedicated label/text field components for each cell?
The problem with the label/text field approach is I would have to make a style class for every part of this pseudo-table to make it in-line with the design document provided by our UX/Visual designer. Basically re-inventing what the grid already does, which already has a built-in theme. Also, for this to be done within 12grid.
sean:
Hi John,
To add to what Gabi says, this is not supported because Servoy grids (NG Grid and Table Component) are data-bound, so each row corresponding to a record in a data source.
Another approach could be to create an in-mem data source, populate with several empty records and bind that data source to a regular grid. Then when the user edits/saves, you transpose it back to your “real” data source. Would be a bit cumbersome, but you would get the desired effect in the UI.
Hmm I see, so the in-memory data source is a copy of the corresponding data sources. Then, when using the edit check the onDataChange to update the corresponding database sources.
I’ll try and make my own table within 12grid containers and if it doesn’t look right I’ll try that in-mem method.
in-memory data sources work great with grids, if the grid is read-only.
If the grid only needs occasional edits, you could attach a method to one of the grid events to pop up a form for editing the specific underlying data source, Servoy passes in record and column so you can work out where you are, and on save or close refresh the in-mem data source.