Commit a421dd6b31fbd543034ba0aead971f413addaba4
- Diff rendering mode:
- inline
- side by side
dss-setup-interface/dSS/util/Util.js
(27 / 0)
|   | |||
| 87 | 87 | } | |
| 88 | 88 | }); | |
| 89 | 89 | } | |
| 90 | |||
| 91 | dSS.util.setValueOnDevice = function(dsid, value) { | ||
| 92 | Ext.Ajax.request({ | ||
| 93 | url: '/json/device/setValue', | ||
| 94 | disableCaching: true, | ||
| 95 | method: "GET", | ||
| 96 | params: { dsid : dsid, | ||
| 97 | value : value }, | ||
| 98 | success: function(result, request) { | ||
| 99 | try { | ||
| 100 | var jsonData = Ext.util.JSON.decode(result.responseText); | ||
| 101 | if (!jsonData.ok) { | ||
| 102 | Ext.MessageBox.alert(_("Could not set value") + ": " + | ||
| 103 | jsonData.message); | ||
| 104 | } | ||
| 105 | } catch (err) { | ||
| 106 | Ext.MessageBox.alert(_("Error"), | ||
| 107 | _("Could not send setValue command to dSS") + ": " + err); | ||
| 108 | } | ||
| 109 | }, | ||
| 110 | failure: function(result, request) { | ||
| 111 | Ext.MessageBox.alert(_("Error"), | ||
| 112 | _("Could not send setValue command to dSS")); | ||
| 113 | } | ||
| 114 | }); | ||
| 115 | |||
| 116 | } |

