PDA

View Full Version : Grid paging help



davisty
20 Jan 2011, 5:22 AM
Hello,

Total Newbie Question ...

I have a grid with 20 rows.
The grids first two columns would contain the key's to the DB positioning.

How do I obtain the value of those cells of the first and last rows?

Thanks in Advance ...

valititi
20 Jan 2011, 5:35 AM
var indexOfYourRows = map(function(o){
return o.rowIndex;
},
yourGrid.getSelectedRows()
);
var yourRows = yourGrid.getDataModel().getRows(indexOfYourRows );
this may be enough ?

davisty
20 Jan 2011, 7:46 AM
Im an *****, Im not sure that I understand how this works.

It has methods that Im not familiar ... How does this obtain the cell values?

Im not talking about selected rows. I only wanting to use the cell values to pass to an ajax program to go forward or backward in the DB based on which button is clicked. This may be doing that but I dont understand

Foster
20 Jan 2011, 10:23 AM
Try something like this:



var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var data = record.get(fieldName);


Sounds like you want the column data at rowIndex 0 and 19 ( your first and last rows)

hopefully some combination of the code above will help you get the data you need

davisty
20 Jan 2011, 2:28 PM
Yes, that should work. Thank You very much.