0
您好,我正在开发一个使用Ext Js的项目,需要编辑网格中的一行。我试图使用我在Ext的文档,插件中找到的插件:[Ext.create('Ext.grid.plugin.RowEditing')],但是当我点击该行时,更新和取消选项出现在网格上,但单元格不可编辑,有人知道发生了什么吗?编辑ExtJs网格中的一行
与插件文档中的例子是这样的:http://docs.sencha.com/ext-js/4-0/#!/example/restful/restful.html
我迄今为止代码:
Ext.define('GridEditavel',{
extend : 'Ext.grid.Panel',
title: 'Grid Editavel',
store: 'GridStore',
dockedItems : [ {
xtype : 'toolbar',
items : [ {
xtype: 'button',
text : i18n['vds.botao.nova.coluna'],
icon : Webapp.icon('add1.png'),
iconAlign : 'top',
handler : function() {
var gridView = Ext.ComponentQuery.query("gridpanel")[1];
Ext.Msg.prompt('Message', 'Enter a column number:', function(
btn, text) {
if (btn == 'ok' && text != null) {
var column = Ext.create('Ext.grid.column.Column', {
text : text
});
gridView.headerCt.insert(gridView.columns.length,
column);
gridView.getView().refresh();
} else {
Ext.Msg.alert('Alert', 'Enter a column number!');
}
});
}
} ]
} ],
columns: [{
header : 'Nome',
dataIndex : 'nome',
flex : 0.8
}],
plugins : [ Ext.create('Ext.grid.plugin.RowEditing') ]});
请使用英语,这样你的答案被更好地理解。 (Por支持,利用línguainglesa para que sua resposta seja melhor entendida。) – 2012-07-19 18:11:41