[英]Cell Editing on ExtJS
I am trying to make my grid.Panel cells editable with one click. 我正在尝试使我的grid.Panel单元格一键可编辑。 I have following code that doesn't work. 我有下面的代码不起作用。 I followed this this link and implemented in my program but still clicking doesn't enable editing. 我点击了此链接,并在程序中实现了该功能 ,但仍然无法点击进行编辑。 I also tried RowEditing but it didn't work either. 我也尝试了RowEditing,但是它也不起作用。 There is no problem getting info from database. 从数据库获取信息没有问题。
Ext.define('CategoryNumberGrid', { extend: 'Ext.grid.Panel', selType: 'cellmodel', pageSize: 25, defineColumns:function(){ this.columns=[ { header: 'Code', dataIndex: 'code', renderer: Ext.util.Format.htmlEncode },{ header: 'Description', dataIndex: 'descr', renderer: Ext.util.Format.htmlEncode }]; }, model: 'CategoryNumberModel', initComponent:function(){ this.defineColumns(); var config = { autoLoad: true, autoSync: true, remoteFilter: true, remoteSort: true, proxy: getProxy("CategoryNumberModel"), model: 'CategoryNumberModel', sorters:[ { property:'code', direction:'ASC' }], pageSize: this.pageSize }; this.Store = Ext.create('Ext.data.Store', config); this.editing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit:1}); this.plugins=[this.editing]; this.callParent(); } });
this.Store
won't help a grid to find its data. this.Store
将无法帮助网格查找其数据。 editor
config . 您的列缺少editor
config 。 I have corrected the issues: https://fiddle.sencha.com/#fiddle/1f41 我已更正了该问题: https : //fiddle.sencha.com/#fiddle/1f41
For future questions, please consider making a working fiddle that exhibits the problem. 对于将来的问题,请考虑制作一个能解决问题的小提琴。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.