:: Forum >> Version 2 >>

How to get the row no in grid

More information on this topic is available in the documentation section: /aw.ui.grid/selected-rows.html.

I have to select multiple rows to perform some operation and need the row no of the rows selected by user. Any suggestions?
Jack
Wednesday, April 5, 2006
You can get the array of the selected row indices with getSelectedRows() method (or as an argument in onSelectedRowsChanged event). The row number (position from the top in the current order) could be obtained with getRowPosition(rowIndex) method.

var obj = new AW.UI.Grid;
    
obj.setCellData(function(colrow){return col "." row});
    
obj.setHeaderText("header");

    
obj.setColumnCount(10);
    
obj.setRowCount(10);

    
obj.setSelectionMode("multi-row");

    
obj.onSelectedRowsChanged = function(rowIndexArray){

        var 
rowIndexrowPositioni"";

        for(
i=0i<rowIndexArray.lengthi++){
            
rowIndex rowIndexArray[i];
            
rowPosition this.getRowPosition(rowIndex);
            
+= " " rowPosition;
        }

        
window.status s;
    }

    
document.write(obj);

 
Alex (ActiveWidgets)
Wednesday, April 5, 2006
Thanks
Jack
Wednesday, April 5, 2006



This topic is archived.

Back to /aw.ui.grid/selected-rows.html

Documentation:

Forum search