定时任务显示的基类
eams.dc.taskMK.TaskItemGrid = Ext.extend(Ext.grid.GridPanel, {
myInfoPanel : null,
mystore : null,
myPStore: null,
actions : null,
searchValue : ' ',
constructor : function(_cfg) {
this.actions = [new Ext.Action({
text : '查询',
iconCls : 'db-icn-back',
handler : function() {
this.onSearch();
},
scope : this
})];
this.myPStore = this.getMyPStore();
this.mystore = this.getStore();
var _tmpcfg = {
border : 0,
autoScroll : true,
clicksToEdit : 0,
cm : this.getCM(),
store : this.mystore,
selModel : new Ext.grid.RowSelectionModel({
singleSelect : true
}),// 设置单行选中模式, 否则将无法删除数据
tbar : [{
xtype : 'label',
text : '任务项名称:'
}, {
xtype : 'textfield',
width : 300,
id : 'srchField'
}, this.actions[0]]
};
var __cfg = Ext.applyIf(_cfg,_tmpcfg);
eams.dc.taskMK.TaskItemGrid.superclass.constructor.call(this, __cfg);
},
onSearch : function() {
var store = this.mystore;
var toolBar = Ext.get('srchField');
this.searchValue = toolBar.getValue();
if(this.searchValue==null||this.searchValue=='undefined') this.searchValue=' ';
store.proxy = new Ext.data.HttpProxy({
url : 'TaskItemAction?op=query&ex=' + encodeURI(this.searchValue)
});
store.load();
},
//var records = this.getSelectionModel().getSelections();
getCM : function() {
var self = this;
return new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer({
header : '序号',
width : 35
}), {
header : '标识',
dataIndex : 'uri',
width:150,
editable : false,
hidden:true
}, {
header : '任务项名称',
dataIndex : 'name',
width:150,
sortable : true
},
{
header : '终端协议标识',
dataIndex : 'protocolUri',
width:200,
renderer: function(v){
if(v){
var comboxStore = self.myPStore;
var index = comboxStore.find('uri',v);
if(index<0) return;
return comboxStore.getAt(index).get('name');
}
}
},
{
header : '终端数据单元',
dataIndex : 'termBuff',
width:150,
editor : new Ext.form.TextField({
allowBlank : false
})
},
{
header : '表计协议标识',
dataIndex : 'ammeterProtocolUri',
width:200,
renderer: function(v){
if(v){
var comboxStore = self.myPStore;
var index = comboxStore.find('uri',v);
if(index<0) return;
return comboxStore.getAt(index).get('name');
}
}
},
{
header : '表计数据单元',
dataIndex : 'ammeterBuff',
width:150,
editor : new Ext.form.TextField({
allowBlank : false
})
}]);
},
getStore : function() {
var store = new Ext.data.JsonStore({
url : 'TaskItemAction?op=query',
method : 'POST',
root : 'datas',
fields : ['name', 'uri', 'termBuff', 'ammeterBuff','protocolUri','ammeterProtocolUri'],
totalProperty : 'totalProperty'
});
store.load();
return store;
},
getMyPStore:function()
{
var store = new Ext.data.JsonStore({ // 填充的数据
fields : ['name','uri'],
url:'ProtocolAction',
root:'PList',
method:'POST'
});
store.load();//实例化时即加载,这样mode:可以设置成local
return store;
}
});
eams.dc.taskMK.TaskItemGrid = Ext.extend(Ext.grid.GridPanel, {
myInfoPanel : null,
mystore : null,
myPStore: null,
actions : null,
searchValue : ' ',
constructor : function(_cfg) {
this.actions = [new Ext.Action({
text : '查询',
iconCls : 'db-icn-back',
handler : function() {
this.onSearch();
},
scope : this
})];
this.myPStore = this.getMyPStore();
this.mystore = this.getStore();
var _tmpcfg = {
border : 0,
autoScroll : true,
clicksToEdit : 0,
cm : this.getCM(),
store : this.mystore,
selModel : new Ext.grid.RowSelectionModel({
singleSelect : true
}),// 设置单行选中模式, 否则将无法删除数据
tbar : [{
xtype : 'label',
text : '任务项名称:'
}, {
xtype : 'textfield',
width : 300,
id : 'srchField'
}, this.actions[0]]
};
var __cfg = Ext.applyIf(_cfg,_tmpcfg);
eams.dc.taskMK.TaskItemGrid.superclass.constructor.call(this, __cfg);
},
onSearch : function() {
var store = this.mystore;
var toolBar = Ext.get('srchField');
this.searchValue = toolBar.getValue();
if(this.searchValue==null||this.searchValue=='undefined') this.searchValue=' ';
store.proxy = new Ext.data.HttpProxy({
url : 'TaskItemAction?op=query&ex=' + encodeURI(this.searchValue)
});
store.load();
},
//var records = this.getSelectionModel().getSelections();
getCM : function() {
var self = this;
return new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer({
header : '序号',
width : 35
}), {
header : '标识',
dataIndex : 'uri',
width:150,
editable : false,
hidden:true
}, {
header : '任务项名称',
dataIndex : 'name',
width:150,
sortable : true
},
{
header : '终端协议标识',
dataIndex : 'protocolUri',
width:200,
renderer: function(v){
if(v){
var comboxStore = self.myPStore;
var index = comboxStore.find('uri',v);
if(index<0) return;
return comboxStore.getAt(index).get('name');
}
}
},
{
header : '终端数据单元',
dataIndex : 'termBuff',
width:150,
editor : new Ext.form.TextField({
allowBlank : false
})
},
{
header : '表计协议标识',
dataIndex : 'ammeterProtocolUri',
width:200,
renderer: function(v){
if(v){
var comboxStore = self.myPStore;
var index = comboxStore.find('uri',v);
if(index<0) return;
return comboxStore.getAt(index).get('name');
}
}
},
{
header : '表计数据单元',
dataIndex : 'ammeterBuff',
width:150,
editor : new Ext.form.TextField({
allowBlank : false
})
}]);
},
getStore : function() {
var store = new Ext.data.JsonStore({
url : 'TaskItemAction?op=query',
method : 'POST',
root : 'datas',
fields : ['name', 'uri', 'termBuff', 'ammeterBuff','protocolUri','ammeterProtocolUri'],
totalProperty : 'totalProperty'
});
store.load();
return store;
},
getMyPStore:function()
{
var store = new Ext.data.JsonStore({ // 填充的数据
fields : ['name','uri'],
url:'ProtocolAction',
root:'PList',
method:'POST'
});
store.load();//实例化时即加载,这样mode:可以设置成local
return store;
}
});

189

被折叠的 条评论
为什么被折叠?



