PDA

View Full Version : Get Cell value in selModel: 'cellmodel' and select multiple cells



navvn
30 Nov 2011, 6:14 AM
Is there any way to get an value of selected cell? Also is it possible to select multiple cell's?

tobiu
30 Nov 2011, 6:18 AM
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.selection.Model-method-getSelection

gives you the selected records.

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.selection.Model-cfg-mode

explains the different modes (multi or simple for your usecase).

navvn
30 Nov 2011, 6:29 AM
var cellmodeld = new Ext.selection.CellModel({
mode: 'MULTI',
listeners: {
select: function(a,b,c,d,f){
}
}
});

Well mate mod Multi is not working and getselection or listener - select return whole rown data, i asked for a cell.

EXTjs 4.0.2

complex14
4 Mar 2012, 11:46 PM
For get cell value. Try this:




listeners: {

cellclick: function(grid, rowIndex, columnIndex, e){

var column = grid.panel.columns[grid.getSelectionModel().getCurrentPosition().column];

var value= e.data[column.dataIndex];


}


i use EXTjs 4.0.7 and it worked fine but select multi cell is not working.