Update gridOptions
Is it possible to update gridOptions object in real time? For an example, I change enable Sorting from true to false and nothing happens.
You probably need to reassign the entire gridOptions object reference and not just an inner property.
On Fri, Jun 6, 2014 at 7:44 AM, klemenoslaj [email protected] wrote:
Is it possible to update gridOptions object in real time? For an example, I change enable Sorting from true to false and nothing happens.
— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ng-grid/issues/1228.
I tried this way also: http://plnkr.co/edit/FfnbLhgllUgysN8ZUJZP?p=preview
You can set column options like this.
var cols = $scope.gridOptions.$gridScope.columns;
var col = cols[0];
col.sortable = true;
col.sortDirection = 'desc';
col.sort(); // if you want to sort this columns programatically
console.dir(col); // for more details...
Thanks. For columns this solution is correct. But what about grouping and sorting functionality? For an example, when grid is displayed, there is no sorting and grouping enabled, but after some action user can enable it both. So how to achieve this?
@klemenoslaj : there is an undocumented grid.refresh() that might permit this, but in general you wouldn't change the grid options after initial render. Is there a reason you can't just leave sorting and grouping enabled from the start?
More information requested on a relatively old issue, and no further comment for 2 weeks, assuming that issued is resolved.