Skip to content

Commit

Permalink
fix(accounts): do not nest grid in ngShow
Browse files Browse the repository at this point in the history
This commit remove the ng-show directive on the ui-grid as it causes
problems with the grid's redraw.  The grid no longer renders properly on
a fresh reload - likely because some $digests were removed for
performance reasons.  This is fixed by removing the `ngShow` directive.
  • Loading branch information
Jonathan Niles authored and jniles committed Apr 8, 2017
1 parent 4780410 commit f15a5cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions client/src/partials/accounts/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@
<div class="row">
<div class="col-xs-12">
<!-- @todo Consider how the application is loaded and cached and make this functionality apply to the whole application -->
<!-- Hide broken UI-Grid on page load -->
<div ng-if="!AccountsCtrl.pageLoaded"><i class="fa fa-spin fa-circle-o-notch"></i></div>
<div
id="account-grid"
style="height : calc(100vh - 65px)"
ng-show="AccountsCtrl.pageLoaded"
class="grid-full-height"
ui-grid="AccountsCtrl.gridOptions"
ui-grid-tree-view
ui-grid-auto-resize
Expand Down
6 changes: 2 additions & 4 deletions client/src/partials/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ AccountsController.$inject = [
* and connecting it with the Accounts data model.
*/
function AccountsController($rootScope, $timeout, AccountGrid, Notify, Constants, Language, uiGridConstants) {

var vm = this;
vm.Constants = Constants;
vm.loading = true;

// account title indent value in pixels
vm.indentTitleSpace = 20;
Expand All @@ -28,7 +28,6 @@ function AccountsController($rootScope, $timeout, AccountGrid, Notify, Constants

// lang parameter for document
vm.parameter = { lang: Language.key };
vm.loading = true;

vm.Accounts = new AccountGrid();
vm.Accounts.settup()
Expand Down Expand Up @@ -102,6 +101,7 @@ function AccountsController($rootScope, $timeout, AccountGrid, Notify, Constants
function registerAccountEvents(api) {
vm.api = api;
api.grid.registerDataChangeCallback(expandOnSetData);
api.grid.handleWindowResize();
}

function expandOnSetData(grid) {
Expand All @@ -123,6 +123,4 @@ function AccountsController($rootScope, $timeout, AccountGrid, Notify, Constants
vm.gridOptions.enableFiltering = !vm.gridOptions.enableFiltering;
vm.api.core.notifyDataChange(uiGridConstants.dataChange.COLUMN);
};

$timeout(function () { vm.pageLoaded = true; });
}

0 comments on commit f15a5cf

Please sign in to comment.