I am encountering an issue with my kendo grid where the data disappears after performing certain actions:
- Reordering columns using mouse drag and drop
- Resizing columns using mouse drag and drop
- Hiding columns through the column menu
- Showing columns through the column menu
After these events, grid.dataSource.data() = null
, leaving only the header row visible in the grid. To address this, I have added the following code to ensure the grid remains intact:
columnReorder: function(e) {
$timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnResize: function(e) {
$timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnHide: function(e) {
$timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
},
columnShow: function(e) {
$timeout(function () {$scope.grid.dataSource.data(e.sender.dataSource.data());});
}
Despite implementing this workaround, I am still unsure as to why the grid data goes missing when manipulating the columns in this way.
If anyone has any insights or solutions, please share them with me. Your help is greatly appreciated.