0
votes

I have a search button that triggers Ajax request to fetch data from DB. When the promise is resolved I populate gridoptions.data. The grid is rendered in the screen. I make some changes in the grid, like hide some columns, enter something into the header filters, change sort order etc.. When I hit the search button again, the data is fetched again and grid is updated with that data but the grid layout remains as is, all the the changes I made earlier in place..

I need to intialize the grid every time I hit search button... I tried redefining gridoptions.columnDefs but that didn't work..

Suggestions please.

1

1 Answers

0
votes

Try:

$scope.gridoptions = {} as the first line in the search function, instead of just clearing the columnDefs.