var TempViewPanel = Ext
var TempViewPanel = Ext.extend(Ext.idip.CrudPanel, {
baseUrl: '/ViewTemplate',
storeMapping: ["id","name","en_name","opt_type","gameid"],
constructor: function(config){
this.sm = '';
this.cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//获得行号
{
header:" <font color=red>接口名称</font>",
tooltip:"接口的中文名称",
dataIndex:"name",
sortable:false,
menuDisabled : true,
align:'left',
resizable:false,
width:200
},{
header:" <font color=red>接口类型</font>",
tooltip:"接口类型",
dataIndex:"opt_type",
sortable:false,
menuDisabled : true,
align:'left',
//renderer: checker,
renderer:function(val){
if(val == 0) {
return '充值类';
}else if(val == 1){
return '查询类';
}else if(val == 2){
return '添加类';
}else if(val == 3){
return '修改类';
}else if(val == 4){
return '删除类';
}
},
resizable:false,
width:200
},{
header:" <font color=red>英文名称</font>",
tooltip:"接口的英文名称",
dataIndex:"en_name",
sortable:false,
menuDisabled : true,
align:'left',
resizable:false,
width:200
},{
header:'业务ID',
dataIndex:'gameid',
menuDisabled : false,
align:'center',
width:10,
resizable:false,
hidden:true
},{
header:'操作',
dataIndex:'id',
menuDisabled : false,
align:'center',
width:100,
resizable:false,
renderer: function(val){return "<a onclick=Import('"+val+"') style='cursor:hand;color:blue;text-decoration:underline'>导入</a>"; }
//hidden:true
}
]);
this.toolbar = [{
id: 'pay_inter',
text: '充值类',
iconCls: 'add',
handler: this.pay_inter,
scope: this
}, '-',{
id: 'query_inter',
text: '查询类',
iconCls: 'modify2',
handler: this.query_inter,
scope: this
}, '-',{
id: 'update_inter',
text: '更新类',
iconCls: 'remove',
handler: this.update_inter,
scope: this
}, '-',{
id: 'modify_inter',
text: '修改类',
iconCls: 'add',
handler: this.modify_inter,
scope: this
},'-',{
id:'del_inter',
text : '删除类' ,
iconCls : 'con-add',
handler: this.del_inter,
scope: this
},'-',{
text: '刷新',
iconCls: 'refresh',
tooltip: this.refreshtooltip,
handler: this.onRefresh,
scope: this
}];
TempViewPanel.superclass.constructor.call(this,config);
} ,
pay_inter:function(){
var store = this.gridPanel.getStore();
var lastOptions = store.lastOptions;
lastOptions.params.type = 0;
store.reload(lastOptions);
},
query_inter:function(){
var store = this.gridPanel.getStore();
var lastOptions = store.lastOptions;
lastOptions.params.type = 1;
store.reload(lastOptions);
},
update_inter:function(){
var store = this.gridPanel.getStore();
var lastOptions = store.lastOptions;
lastOptions.params.type = 2;
store.reload(lastOptions);
},
modify_inter:function(){
var store = this.gridPanel.getStore();
var lastOptions = store.lastOptions;
lastOptions.params.type = 3;
store.reload(lastOptions);
},
del_inter:function(){
var store = this.gridPanel.getStore();
var lastOptions = store.lastOptions;
lastOptions.params.type = 4;
store.reload(lastOptions);
},
onEdit:function(){}
});
var TempView = new TempViewPanel();