Commit a421dd6b31fbd543034ba0aead971f413addaba4

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Wed Jul 28 16:36:22 CEST 2010
Added setValue method
dss-setup-interface/dSS/util/Util.js
(27 / 0)
  
8787 }
8888 });
8989}
90
91dSS.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}