PDA

View Full Version : Create Listener for checkboxSelectionModel



rafaelrp
13 Mar 2012, 10:04 AM
Hello,
I need to create some listeners when i select a checkbox in a row..

Here's the code..
checkbox...

var checkboxes = Ext.create("Ext.selection.CheckboxModel");

grid config...

selModel: checkboxes,

listener...

Ext.getCmp("panelGrid").getSelectionModel().on("select", function(grid, rowIndex, colIndex){ //rec = grid.store.getAt(rowIndex);
Ext.Msg.alert("Selecao", "Line: "+rowIndex);
});

returns...

Line: [object Object]

Needs to returns ex:

Line: 1

Thanks! ~o)

mitchellsimoens
13 Mar 2012, 11:05 AM
The arguments for the select event are: selModel, record, index, opts so use the 3rd argument.

rafaelrp
13 Mar 2012, 11:32 AM
It works !

Thats a way to i add a hidden field on a grid row? like a user id for example..

Thanks ! ~o)

rafaelrp
13 Mar 2012, 12:21 PM
Solved !

Thanks ! ~o)