PDA

View Full Version : [DUP] [4.0.1] RowEditor on hidden column



stever
2 Jun 2011, 2:28 PM
Using this example:

http://dev.sencha.com/deploy/ext-4.0.1/examples/restful/restful.html

Change the first column to have a hidden:true. Then when you pull up the row editor, it brings up the hidden column and moves all the columns in the editor over a column so they don't match. Showing the hidden column via the menu and then hiding again will give the desired behavior.

netzpirat
16 Jun 2011, 5:18 AM
I can confirm that this bug still exists in 4.0.2a. The problem is that the editor is initialized with all configured header columns and not only the visible ones.

Here's a patch with the fix for it:



Index: public/lib/ext4/ext-all-debug.js
===================================================================
--- public/lib/ext4/ext-all-debug.js (date 1308227252000)
+++ public/lib/ext4/ext-all-debug.js (revision )
@@ -81110,7 +81110,7 @@
return Ext.create('Ext.grid.RowEditor', {
autoCancel: me.autoCancel,
errorSummary: me.errorSummary,
- fields: headerCt.getGridColumns(),
+ fields: Ext.Array.filter(headerCt.getGridColumns(), function(column) { return !column.hidden }),
hidden: true,


UPDATE: The above patch doesn't work properly.

I found another solution that seems to work: Just update the hidden status of the associated editor in Ext.grid.RowEditor when the component gets initialized.



Index: public/lib/ext4/ext-all-debug.js
===================================================================
--- public/lib/ext4/ext-all-debug.js (date 1308230408000)
+++ public/lib/ext4/ext-all-debug.js (revision )
@@ -76548,6 +76548,12 @@
delete me.fields;
}

+ this.columns.each(function(id, column) {
+ if (column.isHidden()) {
+ column.getEditor().hide();
+ }
+ });
+
form = me.getForm();
form.trackResetOnLoad = true;
},


I'd have sent you a pull request on GitHub, but Subversion is a no-go :P

netzpirat
16 Jun 2011, 11:45 PM
Can someone of the Sencha team confirm this bug? I want to make sure that the next version has a proper fix for this issue.

ap
27 Jun 2011, 5:34 AM
Can someone of the Sencha team confirm this bug? I want to make sure that the next version has a proper fix for this issue.

http://www.sencha.com/forum/showthread.php?137529-OPEN-EXTJSIV-2540-4.0.2-Rowediting-rendering-problem-with-hidden-column

netzpirat
27 Jun 2011, 5:48 AM
Thanks ap for linking the issue.

wavded
27 Jun 2011, 7:13 AM
Any ETA on this issue being fix in a new release? Or new version of Row Editing to plug in for the time being?