PDA

View Full Version : [CLOSED] getColumnModel does not work in 2.0 (port from 1.5 to 2.0)



gets_gui
Oct 15, 2012, 7:05 PM
Hi,

We are trying to port some code written from Ext.net 1.5 to work on Ext.net 2.0 and faces a problem for the following code. It complains e.grid.getColumnModel() is not defined etc. I am attaching the JavaScript code below. Can you let us know how we can port this piece of code?



var afterCheckBoxEdit = function(e) {
var id = e.grid.getColumnModel().getColumnId(e.column);
if (id == 'CheckMatchClientColumn' || id == 'CheckMatchJefColumn') {
//alert('rowIndex: ' + e.row + '\nbefore: ' + e.originalValue + '\nafter: ' + e.value);
if(e.record.data.selectedForMatches == true || e.record.data.jselectedForMatches == true)
e.grid.getSelectionModel().selectRow(e.row, true);
else {
e.grid.getSelectionModel().deselectRow(e.row, false);
}
}
}

Daniil
Oct 15, 2012, 7:09 PM
Hi @gets_gui,

Thank you for the report. We should add a respective changelog item.

Within an Edit listener you can use

e.column.id

See also
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.plugin.Editing-event-edit

gets_gui
Oct 15, 2012, 7:39 PM
We have a grid with a check column.
Once the check column is checked, we would like to add the row to the grid selection.

And we just checked that there is no e.column in the event (RowEditing).

Daniil
Oct 16, 2012, 5:49 AM
In this case I would set a CheckColumn CheckChange listener to achieve the requirement.

gets_gui
Oct 16, 2012, 1:35 PM
That's exactly what we have done.
Thanks!