Re-using a grid with new data/columns
I'm using ng-grid to pull tables from a db and view/edit them. Since I dont have to define a column model, ng-grid is perfect. However, I would like to use the same grid instance over and over, and update the data and columns. Right now, when you update the data being referenced in the grid options object, it does indeed update the data, but the old columns remain. Simple way to reset a grid that I missed in the docs?
currently, for this to work you would need to specify columnDefs (very simple {field: "prop"} would be sufficient. and then overwrite the column definitions when you change the data model.
We can take a look at adding support, possibly a "rebuildColumns" method or something like that to help facilitate this.
Ok, great. It would appear that since I have no idea what columns are coming back, I'll have to preprocess the data, get the data object's keys and use those as column definitions, and overwrite both the data and column defs. I may be over simplifying that, but I'll give this a shot, thanks again!
This would really be great. Currently I'm trying to push new ColumnDefs dynamically, but it doesn't work as expected :(. So :+1: (p.s.: Any Roadmap for this feature? :) )
Forget it: already found a solution: https://github.com/angular-ui/ng-grid/issues/36