3.2.0

Paging..

Hello,

I just discover the grid control asn its look great..
I am testing it just now with a set of 5000 records from a MySQL database.. (this is my need)
For now, i just display (as in example) a set of records from 0 to 25

2 questions :
- How do i paginate the display in the grid with navigation buttons (next, previous).. ? is it possible ?
- How can i change the columns heading when datas comes from MySQL ?

if you can help me, or give me the way ...Thank you
Denis
July 22,
There is an example in the download
July 25,
Can anyone be a litte more specific on how this is done, or at least let me know which example in the download does this?
Shane
June 29,
Pagin that is ...
Shane
June 29,
Its very easy... just set the rowCount and RowIndices.

First:

Indices = [0,1,2,3,4,5,6,7,8,9,10]
rowCount = 11

Second:
Indices = [11,12,13,14,15,16,17,18,19]
rowCount = 10

etc...

obj.setRowIndices([indices]);
obj.setRowCount(xx);
Paulo Cesar Silva Reis (PC from Brazil).
June 29,
I am actually try to paginate within the grid. This would work if I had multiple pages and fixed data, but I am trying to limit my rowcount by say taking 1000 records, only displaying 100 and putting paging that would enable me to jump up 100 records until I was at the end of the recordset.

?
Shane
June 29,
Another approach would be using row offset property - grid displays rows from rowOffset to rowOffset+rowCount-1

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

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

document.write(obj);
document.write("<br>");

var button = new AW.UI.Button;
button.setControlText("Next");
document.write(button);

button.onControlClicked = function(){
    var x = obj.getRowOffset();
    obj.setRowOffset(x+10);
    obj.refresh();
}


Unfortunately sorting breaks in this scenario (bug).
Alex (ActiveWidgets)
June 29,

This topic is archived.

See also:


Back to support forum