2024年4月26日发(作者:)

Extjs4.2 Grid单元格编辑

效果图:

实现代码:

/**

* @Description 代码生成器-单表-行编辑模式 视图层

* @author 张川(cr10210206@)

* @date 2014-01-13 11:22:12

*/

(View('neRowView'),{

extend : '',

alias : '_test_TcodeoneRowView',//视图别名

layout : 'border',

border : 0,

items : [{

region : 'north',

xtype : 'panel',

height : 0,

border : 0,

items : [{

'xtype' : 'hiddenfield',

'id' : 'view_test_TcodeoneRowView_tbar_storeCount'

}]

},{

region : 'center',

xtype : 'gridpanel',

layout : 'fit',

border : 0,

forceFit : true,//自动填充单元格

selType : 'checkboxmodel',//多选框模式

columns : [{

dataIndex : 'id'

,text : '编号'

,width : 100

,align : 'center'

,sortable : false

,hidden : true

,hideable : false

},{

dataIndex : 'name'

,text : '姓名'

,width : 100

,align : 'center'

,sortable : false

,editor : {

xtype : 'textfield'

}

},{

dataIndex : 'birthday'

,text : '出生日期'

,width : 100

,align : 'center'

,sortable : false

,renderer : nderer('Y-m-d')

,editor : {

xtype : 'datefield'

,format : 'Y-m-d'

}

},{

dataIndex : 'status'

,text : '状态'

,width : 100

,align : 'center'

,sortable : false

,renderer:function(value,metaData,record,rowIndex,columnIndex,str

oe,view){

var result = '';

if(value == 1){

result = '启用';