Skip to content

Commit

Permalink
perf(uiGrid): use performance feats where possible
Browse files Browse the repository at this point in the history
This commit changes the majority of the ui-grids to use
`flatEntityAccess` and `fastWatch` where possible.  This includes all of
the registries.

It also adds the `ngTouch` module for better behavior on mobile.

Closes #1039.
  • Loading branch information
Jonathan Niles committed Dec 22, 2016
1 parent a0bd913 commit de20485
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions client/src/partials/finance/reports/cash_payment/cash_payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,16 @@ function CashPaymentRegistryController(Cash, bhConstants, Notify, Session, Modal
}, {
field : 'amount', displayName : 'TABLE.COLUMNS.AMOUNT', headerCellFilter: 'translate',
cellTemplate: 'partials/finance/reports/cash_payment/templates/amount.grid.html'
},
{ field : 'cashbox_label', displayName : 'TABLE.COLUMNS.CASHBOX',
headerCellFilter: 'translate'
},
{ field : 'display_name', displayName : 'TABLE.COLUMNS.USER',
headerCellFilter: 'translate'
},
{ field : 'action', displayName : '...',
cellTemplate: 'partials/finance/reports/cash_payment/templates/action.grid.html',
enableFiltering: false
},
{ field : 'action', displayName : '',
cellTemplate: 'partials/finance/reports/cash_payment/templates/cancelCash.action.tmpl.html',
enableFiltering: false
}, {
field : 'cashbox_label', displayName : 'TABLE.COLUMNS.CASHBOX', headerCellFilter: 'translate'
}, {
field : 'display_name', displayName : 'TABLE.COLUMNS.USER', headerCellFilter: 'translate'
}, {
field : 'action', displayName : '', enableFiltering: false, enableSorting: false,
cellTemplate: 'partials/finance/reports/cash_payment/templates/action.grid.html'
}, {
field : 'action', displayName : '', enableFiltering: false, enableSorting: false,
cellTemplate: 'partials/finance/reports/cash_payment/templates/cancelCash.action.tmpl.html'
}
];

Expand Down Expand Up @@ -133,15 +129,15 @@ function CashPaymentRegistryController(Cash, bhConstants, Notify, Session, Modal
// load cash
function load(filters) {
Cash.search(filters)
.then(function (rows) {
rows.forEach(function (row) {
row._backgroundColor =
(row.type_id === bhConstants.transactionType.CREDIT_NOTE) ? reversedBackgroundColor : regularBackgroundColor;
});
.then(function (rows) {
rows.forEach(function (row) {
row._backgroundColor =
(row.type_id === bhConstants.transactionType.CREDIT_NOTE) ? reversedBackgroundColor : regularBackgroundColor;
});

vm.gridOptions.data = rows;
})
.catch(Notify.handleError);
vm.gridOptions.data = rows;
})
.catch(Notify.handleError);
}

// Function for Cancel Cash cancel all Invoice
Expand Down

0 comments on commit de20485

Please sign in to comment.