PDA

View Full Version : [CLOSED] How to use eachRow and eachCell in Ext.grid.selection.Cells ?



siyahgul
Apr 17, 2016, 8:24 PM
http://docs.sencha.com/extjs/6.0/6.0.2-classic/#!/api/Ext.grid.selection.Cells

How to use eachRow and eachCell in Ext.grid.selection.Cells.
I can't find examples.

fabricio.murta
Apr 18, 2016, 10:16 PM
Hello @siyahgul!

I've experimented a little with it and could use it on this example: Grid Panel - Spreadsheet selection model - select programatically (http://examples4.ext.net/#/GridPanel/Spreadsheet/Select_Programmatically/)

On this example (open the direct link version if you want to test with the live EE version, here (http://examples4.ext.net/Examples/GridPanel/Spreadsheet/Select_Programmatically/)), select a block of cells. Do not select whole rows or whole columns, else it would fit another classes!

Then open development console (or, if you're editing the file yourself, create a javascript script block) containing:


var cellShow = function(cellContext, columnId, lineId) {
console.log('selected on line ' + lineId + ', column ' + columnId + ': ' + cellContext.getCell().dom.innerText );
}

var selection = App.SpreadsheetSelectionModel1.getSelected();
selection.eachCell(cellShow, selection);


You might wrap the last line in a function and call by a button click if you are not running this from console.

Similarly would work the eachRow you also are curious about.

I hope this helps!

siyahgul
Apr 19, 2016, 10:55 PM
hi.
very thank you.
I love ext.net
good work.