信息添加
当前日期
PM2.5
当前温度
$("#zTree-cab").bind("cabZtreeOnClick", function (event, node) {
_id = node.objID, _type = node.type, _name = encodeURI(node.name);
if (_id == undefined || _id == null)
_id = node.id;
if (_type == 'LED') {
$.ajax({
type: "Post",
dataType: "json",
url: "./BackHandler/DataManageHandler.ashx",
data: { page: "formledinfo", execute: "select", datas: _id },
beforeSend: function () {
Metronic.blockUI({
target: '#tab',
overlayColor: 'none',
animate: true
});
},
error: function (msg) {
alert("加载超时,可能网速比较慢!" + msg);
},
success: function (data) {
if (data!=null) {
for (var i = 0; i < data.length; i++) {
if (data[0].IsinputTxt) {
$("#txtTXT").attr("checked", true);
}
if (data[0].IsTemper) {
$("#txtTemper").attr("checked", true);
}
if (data[0].IsPM25) {
$("#txtPM25").attr("checked", true);
}
if (data[0].IsCurrentDate) {
$("#txtDate").attr("checked", true);
}
if (!data[0].BrightnessControl) {
$("#DisplayType0").val(0);
} else {
$("#DisplayType0").val(1);
}
$("#SlidingType").val(data[0].SlidingType);
if (!data[0].TemperatureSensor) {
$("#TemperatureSensor").val(0);
} else {
$("#TemperatureSensor").val(1);
}
$("#ip").val(data[0].VMSIP);
if (!data[0].Photocell) {
$("#Photocell").val(0);
}
else {
$("#Photocell").val(1);
}
}
}
}
});
}
});
ajax返回回来的数据是没有问题的那几个checkbox返回的都是true