var pointList = [];
for(var i=0; i<PointStore.getRange().length; i++){
var point = {
name : PointStore.getRange()[i].data.name,
shortname : PointStore.getRange()[i].data.shortname,
checkcontext : PointStore.getRange()[i].data.checkcontext,
code : PointStore.getRange()[i].data.code,
deviceno : PointStore.getRange()[i].data.deviceno,
type : PointStore.getRange()[i].data.type,
locationid : PointStore.getRange()[i].data.locationid,
locationname : PointStore.getRange()[i].data.locationname,
description : PointStore.getRange()[i].data.description,
status : 1, // 新增默认是启用状态
operator : operator
}
pointList.push(point);
}
var jsonData = {
'pointList' : pointList,
'contentId' : contentId
}
Ext.MessageBox.confirm("提示", "确定添加?", function(btn) {
if(btn == 'yes'){
Ext.Ajax.request({
url : "",
jsonData : jsonData,
method : 'POST',
timeout : 6000,
success : function(response,opts) {
var result = eval('('+ response.responseText+ ')');
if(result.success){
win.close();
Ext.Msg.alert("提示", result.message);
var store = Ext.data.StoreManager.lookup('Point');
store.load();
}else{
win.close();
Ext.Msg.alert("提示", result.message);
}
},
failure :function(){
win.close();
Ext.Msg.alert("提示", '操作失败');
}
})
}
})
for(var i=0; i<PointStore.getRange().length; i++){
var point = {
name : PointStore.getRange()[i].data.name,
shortname : PointStore.getRange()[i].data.shortname,
checkcontext : PointStore.getRange()[i].data.checkcontext,
code : PointStore.getRange()[i].data.code,
deviceno : PointStore.getRange()[i].data.deviceno,
type : PointStore.getRange()[i].data.type,
locationid : PointStore.getRange()[i].data.locationid,
locationname : PointStore.getRange()[i].data.locationname,
description : PointStore.getRange()[i].data.description,
status : 1, // 新增默认是启用状态
operator : operator
}
pointList.push(point);
}
var jsonData = {
'pointList' : pointList,
'contentId' : contentId
}
Ext.MessageBox.confirm("提示", "确定添加?", function(btn) {
if(btn == 'yes'){
Ext.Ajax.request({
url : "",
jsonData : jsonData,
method : 'POST',
timeout : 6000,
success : function(response,opts) {
var result = eval('('+ response.responseText+ ')');
if(result.success){
win.close();
Ext.Msg.alert("提示", result.message);
var store = Ext.data.StoreManager.lookup('Point');
store.load();
}else{
win.close();
Ext.Msg.alert("提示", result.message);
}
},
failure :function(){
win.close();
Ext.Msg.alert("提示", '操作失败');
}
})
}
})