diff options
Diffstat (limited to 'web/app/view/NotificationsController.js')
-rw-r--r-- | web/app/view/NotificationsController.js | 13 |
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(); }, |