简体   繁体   English

ExtJS上的单元格编辑

[英]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(); } }); 

  • Your sample is not complete (not runnable) as per the question guidelines. 根据问题准则,您的样本不完整(不可运行)。
  • JavaScript is case-sensitive. JavaScript区分大小写。 this.Store won't help a grid to find its data. this.Store将无法帮助网格查找其数据。
  • Your columns are lacking the 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.

相关问题 单元格编辑如何与 extjs 商店经理一起使用? - How cell editing works with extjs store manager? ExtJS 4.1-编辑单元格时消失的选择(组合框编辑器) - ExtJS 4.1 - Disappearing selection when editing cell (ComboBox editor) ExtJs 6.0:使用组合框编辑网格单元-不同步id值 - ExtJs 6.0 : Grid Cell Editing with a Combobox - Not Syncing the id value ExtJS 4提供的建议,帮助:网格:单元格编辑:自动编辑功能 - Advice, help needed with ExtJS 4: grid: cell editing: auto edit feature 在extjs网格单元格编辑中使用beforecheckchange侦听器获取单元格div ID - Get cell div id using beforecheckchange listener in extjs grid cell editing ExtJs-Javascript-网格中的组合框(单元格编辑插件)-网格/窗口后面的下拉列表 - ExtJs - Javascript - ComboBox in Grid (Cell editing plugin) - Drop down list behind the Grid/Window 如何避免在使用单元格编辑的ExtJS网格上按两次保存按钮 - How to avoid pressing save button twice on an ExtJS grid that uses cell editing 自定义编辑完成后,如何强制ExtJS考虑更改的网格单元中的值? - How to force ExtJS to consider value in grid cell changed after custom editing completes? ExtJS 4 网格行编辑帮助 - ExtJS 4 Grid Row editing help ExtJS 4 单元格编辑 treePanel - ExtJS 4 cell edit for treePanel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM