aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/NotificationsController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-27 17:41:39 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-27 17:41:39 +0500
commit2716bcccafb3ec2f19858a5e5fea262af2a8cb30 (patch)
tree6bbdd9311c87677a5edbb862a83604771c4ec23b /web/app/view/NotificationsController.js
parent395779143dd61df7ba526ee7a80a91094291a30b (diff)
downloadtrackermap-server-2716bcccafb3ec2f19858a5e5fea262af2a8cb30.tar.gz
trackermap-server-2716bcccafb3ec2f19858a5e5fea262af2a8cb30.tar.bz2
trackermap-server-2716bcccafb3ec2f19858a5e5fea262af2a8cb30.zip
Made code more universal
Diffstat (limited to 'web/app/view/NotificationsController.js')
-rw-r--r--web/app/view/NotificationsController.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/web/app/view/NotificationsController.js b/web/app/view/NotificationsController.js
index 1638e4520..a7c4290ca 100644
--- a/web/app/view/NotificationsController.js
+++ b/web/app/view/NotificationsController.js
@@ -45,16 +45,17 @@ Ext.define('Traccar.view.NotificationsController', {
}
});
},
-
+
onBeforeCheckChange: function (column, rowIndex, checked, eOpts) {
+ var fields = column.dataIndex.split('\.',2);
var record = this.getView().getStore().getAt(rowIndex);
- var attributes = record.getData().attributes;
- if (!attributes[column.dataIndex]) {
- attributes[column.dataIndex] = "true";
+ var data = record.get(fields[0]);
+ if (!data[fields[1]]) {
+ data[fields[1]] = "true";
} else {
- delete attributes[column.dataIndex];
+ delete data[fields[1]];
}
- record.set('attributes', attributes);
+ record.set(fields[0], data);
record.commit();
},