Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  




           


Angular ui-grid does not clear cell data when reloaded
In IE Edge and some old IE11 instances, Angular ui-grid does not clear cell data when reloaded via server call.

Fix: change FROM
$scope.reportGrid.data = data.Data;
$scope.reportGrid.totalItems = data.Count; // (if applicable)

TO:
if ($scope.reportGrid.data)
$scope.reportGrid.data.length = 0; // IE EDGE bugfix - if data cell was cleared, old value is cached

$timeout(function ()
{ // resize grid doesn't work if this was called from grid event, so update data after a timeout

$scope.reportGrid.data = data.Data;
$scope.reportGrid.totalItems = data.Count;// (if applicable)
$scope.gridApi.core.handleWindowResize();

// fixes issue with UI rendering
if (!$scope.$$phase) {
$scope.$apply();
}
}, 1);

The main key here is to clear the data array before loading

Created By: amos 6/14/2019 1:35:45 PM