mbts.balance_owed often arrives as a string, so we provide here a custom
comparator function that runs the values through parseFloat() before comparing
them.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Andrea Neiman <abneiman@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
path="acp.alert_message"></eg-grid-field>
<eg-grid-field label="[% l('Balance Owed') %]"
- path='mbts.balance_owed'></eg-grid-field>
+ path='mbts.balance_owed' comparator="sort_money"></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path="copy_barcode">
<!-- FIXME: ng-if / ng-disabled not working since the contents
var today = new Date();
$scope.renewalArgs = {due_date : today};
+ $scope.sort_money = function (a,b) {
+ var ma = parseFloat(a);
+ var mb = parseFloat(b);
+ if (ma < mb) return -1;
+ if (ma > mb) return 1;
+ return 0
+ }
+
$scope.gridDataProvider = egGridDataProvider.instance({
get : function(offset, count) {
return this.arrayNotifier($scope.renewals, offset, count);