:: Forum >>

Paging 2.5

Alex

I have used the following code bit from you to develop paging in 2.02, it worked nice, but in 2.5 setRowOffset(x) start in the x row, meaning that the grid seams empty on page 2.

The reason why i can see this is offset is 32 but there is space enough to see 34, so page 2 only shows 2 rows in row 33 and 34.

Try your own example in version 2.5 and you will se the problem.

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();
}

Alex Code from:
http://www.activewidgets.com/javascript.forum.12092.28/paging-with-version-2-0.html
Armit
Wednesday, December 5, 2007
Armit,
The new (and fast) rendering engine in version 2.5 requires to do little changes to Alex's paging-offset sample:
- disable VirtualMode
- use rowsTemplate refresh instead of a full-grid refresh.

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

obj.setColumnCount(10);
obj.setRowCount(1000); //real rows

var totalrows = obj.getRowCount();
obj.setRowCount(10); //paged rows

obj.setVirtualMode(false);
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();
if ( x < totalrows ){
obj.setRowOffset(x+10);
obj.getRowsTemplate().refresh();
}
}

Carlos
Wednesday, December 5, 2007
Carlos,

Thanks for the answer, where do you find this information about changes from 2.02 to 2.5, so that i don't have to bother people on this board whit questions i can find my self, or there are solutions to all the workarounds in my code.

Thanks



Flaffer
Wednesday, December 5, 2007
Sorry to say, I don't keep any magical book , it's all based on search the forum, Docs, Alex's postings, and also my own experience doing loooots of testing & experimenting things for a private app plus a personal proyect that someday...... ;-)
Anyway its not that difficult to reach a mid "level" after learning some "thricks", but I agree that takes it's time, and mostly doing "search & test" - what else - it is S*ftw*r* - :-(
Carlos
Wednesday, December 5, 2007
Sorry, I did not publish the list of all changes yet (still working on it). Should be ready in 2-3 days.
Alex (ActiveWidgets)
Wednesday, December 5, 2007
The problem with rowOffset is now fixed in AW 2.5.1
Alex (ActiveWidgets)
Tuesday, December 11, 2007

This topic is archived.


Back to support forum

Forum search