I'm facing an issue where ng-grid data does not display on column resizing, when column names change.
Created a plunkr at - http://plnkr.co/edit/eV9baoDOV9A46FZmKW8G?p=preview
Please note the below function in main.js to explicitly change the column names and corresponding data.
$scope.reload = function(){
$scope.columnDefinitions = [
{field: 'first_col'},
{field: 'second_col'}
];
$scope.myData = [{first_col: "colData1", second_col: "colData2"},
{first_col: "colData3", second_col: "colData4"},
{first_col: "colData5", second_col: "colData6"}
];
}
Steps -
Scenario 1 (works).
- Once the example fully loads including data from ng-grid, click on the "change" button.
- With that, the "name" and "age" columns will change to "first_col" and "second_col" along with corresponding data.
Scenario 2 (doesn't work)
- Rerun the example.
- Once the example fully loads including data from ng-grid, resize the columns a bit.
- After resizing, click the "change" button.
- The grid now shows up as empty.
Really stuck with this issue. Any help will be much appreciated.