diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-28 22:41:07 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-28 22:41:07 +1200 |
commit | a5f47492857a175548beff07cfb565129f687ae2 (patch) | |
tree | d5650b6f5db7de9296d8d00cab505b9f594112f6 /web/DeviceView.js | |
parent | c14f99819add0971a82ced01bf6d54ed77aedb74 (diff) | |
download | trackermap-server-a5f47492857a175548beff07cfb565129f687ae2.tar.gz trackermap-server-a5f47492857a175548beff07cfb565129f687ae2.tar.bz2 trackermap-server-a5f47492857a175548beff07cfb565129f687ae2.zip |
Implement API to create devices
Diffstat (limited to 'web/DeviceView.js')
-rw-r--r-- | web/DeviceView.js | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/web/DeviceView.js b/web/DeviceView.js index 4414b67ea..06cec7779 100644 --- a/web/DeviceView.js +++ b/web/DeviceView.js @@ -21,7 +21,22 @@ Ext.define('DeviceView', { title: Strings.device_title, tbar: [{ - text:'Add' + text:'Add', + handler: function() { + + var device = { + name: "AjaxTest", + uniqueId: "UniqueId" + }; + + Ext.Ajax.request({ + url: '/api/device/add', + jsonData: Ext.encode(device), + success: function() { + alert("success"); + } + }); + } }, { text:'Edit' }, { @@ -56,14 +71,14 @@ Ext.define('DeviceView', { fields:[ 'id', 'name', - 'unique_id', - 'position_id', - 'data_id' + 'uniqueId', + 'positionId', + 'dataId' ] }, columns: [ { text: Strings.device_name, dataIndex: 'name', flex: 1 }, - { text: Strings.device_identifier, dataIndex: 'unique_id', flex: 1 } + { text: Strings.device_identifier, dataIndex: 'uniqueId', flex: 1 } ] }); |