PDA

View Full Version : RowEditing & Locking capability



Pacos
26 Jan 2012, 2:46 AM
Hi,

I've tried to instanciate a grid panel with a RowEditor, and 2 locked columns, but it doesn't work. Error :


headerCt is undefined

Apparently, with locked columns the grid in fact contains 2 subgrids, and the main grid doesn't have a headerCt.

Is there any hope of being able to combine a RowEditor within a grid with locked columns ?

Thanks in advance !

Farish
26 Jan 2012, 3:24 AM
I dont know if I have correctly understood what you are trying to achieve. If you mean that you simply dont want to allow users to edit these 2 columns, then just remove the editor from there 2 columns. that way, when the row editor is activated, you can change the other columns but these 2 are not editable.

Pacos
26 Jan 2012, 4:22 AM
That's not what I'm trying to do, sorry if I haven't been very clear.

What I want :
- A grid
- With the first two columns "locked" (like in Excel when horizontal scrolling doesn't affect these columns - you can see an example here : http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/locking-grid.html)
- A RowEditor, allowing me to edit the grid's data, including the first two columns

Farish
26 Jan 2012, 5:07 AM
Ok. I tried doing this with my grid and got the same error. However, when I added
columnLines: true to the grid config (like in the example), the grid did appear although there are some other errors now and the rows arent editable...

Farish
26 Jan 2012, 5:24 AM
the other error


this.headerCt is undefined

does not appear in Ext JS 4.0.7!

Pacos
26 Jan 2012, 5:29 AM
I don't see why the columnLines option should change anything in this problem... I tried to add this option, but the grid comportment (and the error about the headerCt) is still exactly the same. Only difference is - obviously - that lines are now displayed between each column :)

I forgot to specify that I'm using 4.0.7.

Edit : our posts crossed, and I confirm that I get the following error using 4.0.7 (whatever columnLines value is specified) :


headerCt is undefined

which happens on line 83893 of ext-all-debug.js, inside the initEditor function of RowEditor :


initEditor: function() {
var me = this,
grid = me.grid,
view = me.view,
headerCt = grid.headerCt;

return Ext.create('Ext.grid.RowEditor', {
autoCancel: me.autoCancel,
errorSummary: me.errorSummary,
fields: headerCt.getGridColumns(),

hidden: true,


editingPlugin: me,
renderTo: view.el
});
},

Farish
26 Jan 2012, 6:07 AM
I agree that columnLines shouldnt cause any difference. From what I understand, since there are 2 grids now (the locked columns form a separate grid), the roweditor fails to get the columns because there are 2 grids. This might be a bug. Although I cant say for sure coz I havent digged into the code to check it out. I am afraid I am out of ideas.

Pacos
26 Jan 2012, 6:31 AM
Yeah I didn't really hope that it would work natively, given the way the lock columns are implemented. I just wanted to be sure that it's just a non-feature and not a bug.

Thanks for you help !