EditorGridPanel的基本使用方法

[color=red][b]EditorGridPanel的基本使用,添加一个条件过滤功能。[/color][/b]

Editable = Ext.extend(Ext.grid.EditorGridPanel,{

mymenu : null ,
constructor : function(){

this.mymenu = new Ext.form.ComboBox({
triggerAction : 'all' ,
mode : 'local' ,
store : new Ext.data.SimpleStore({
data : [['收入'],['支出']] ,
fields : ['type']
}) ,
displayField : 'type' ,
valueField : 'type' ,
listeners : {
'select' :{
fn : function(_combo,_r,index){
this.filterData(_combo,_r,index) ;
} ,
scope : this
}
}
}) ;
Editable.superclass.constructor.call(this,{
width : 400 ,
height : 400 ,
tbar : ['查询条件',this.mymenu] ,
store : new Ext.data.SimpleStore({
data : [['收入',300],['支出',20],['收入',5000],['支出',1000]] ,
fields : ['type','money']
}) ,
colModel : new Ext.grid.ColumnModel({
columns :[{
header : '类型' ,
dataIndex : 'type' ,
editor : new Ext.form.TextField({
allowBlank : false
})
},{
header : '金额' ,
dataIndex : 'money' ,
editor : new Ext.form.NumberField({
allowBlank : false
})
}]
}) ,
renderTo : 'editable' ,
filterData : function(_combo,_r,index){
//this.store.filter('type',_combo.)
this.store.filter('type',_combo.getValue()) ;
},
listeners : {
'afteredit' : {
fn : function(_obj){
_obj.record.commit() ;
this.filterData(this.mymenu) ;
} ,
scope : this
}
}
})
}
})
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值