Generating ColumnDefs dynamically
Is there a way to build ColumnDefs everytime the data changes?
In my case, different columns may be returned from the server and need to displayed in the same container.
I could create ColumnDefs from that data every time I change data but just wanted to know if there is an option like "dynamicColumn" which takes boolean and ensures that columnDefs are built again when data is changed(since we anyways watch the data).
If you set the columnDef property to a string, ng-grid puts a watcher on the corresponding object, as you are most likely doing with data as well.
So, if you have the object $scope.myColumnDef that you wanted to use dynamically, set the columnDef propery to be 'myColumnDef'
Currently, I am generating columnDefs again but I wanted to know if there is an option so that columnDefs is generated automatically.
Ah, I see what you're asking for now. If you don't define them, they are auto generated. No idea what happens if you added a column to the data with undefined columns...