直接上代码!
formSelected: function (me, record) {
console.log(record.data);
var icwmStatusForm = this.lookup("icwmStatusForm");
icwmStatusForm.getForm().setValues({
"iiSn": record.data.iiSn,
"sysState": ''
});
//下面的是定时的 function是定时需要执行的东西
var task = {
run : function () {
let iiSn = icwmStatusForm.getForm().getValues().iiSn;
if(!iiSn){
iiSn = record.data.iiSn;
}
Ext.Ajax.reqParams('~/xxx/icwm_sys_status_info.json',
{iiSn: iiSn},
function (data) {
var value = null;
if(data.data){
value = data.data;
}else{
value = {
"iiSn": iiSn,
"sysState": ''
};
}
icwmStatusForm.getForm().setValues(value);
}, true
);
},
interval : 2000, //2秒刷新一次
scope : this
};
//定时执行任务
Ext.util.TaskManager.start(task);
}