:: Forum >> Version 1 >>

Server-side paging and sort

Hi all!

Your grid is visually wonderful but if I had to say something bad about it is that it's designed for server-side operation... I mean... when data for a grid weights too much (more than 100 typical records) it's needed to fetch results from server in small blocks (Page By Page Iterator Pattern) and grid into JSP must not sort local data (which is only a page)... instead is needed to do a postback and then repaint grid with sorted data (sorting all data and then painting only corresponding page).

I've already seen your "paging" patch but I think it doesn't solve this problem.

Sorry for my english... but it's a typical problem so I'm sure all you know what I'm trying to tell.

Well. I use "Javascriptools" grid (http://javascriptools.sourceforge.net/) because it solves this matter perfectly. It has two "operation modes" (Client-side and Server-side):
- Client-side mode is very similar to your grid.... but...
- Server-side mode allows to do this:
--------------------------------------------------------
var table = new JavascripTable(....);
...
table.operationMode = JST_SERVER_SIDE;
table.updateTableFunction = theUpdateCallback;
table.rowCount = theTotalCount;
table.currentPage = ( (theTotalCount>theCount)?( (theStartIndex / theCount) + 1):(1) );
....
//add the rows and cols
...
table.render()
--------------------------------------------------------

where theUpdateCallback is a simple function like this:
--------------------------------------------------------
function updateTable(table) {
var sortColumn = table.sortColumn;
var sortProperty = sortColumn < 0 ? "" : sortableColumnsIds[sortColumn];
setValue("count", table.pageSize);
setValue("startIndex", (table.currentPage-1)*table.pageSize);
setValue("sortField", sortProperty);
setValue("sort", table.ascSort ? "1" : "2");
document.xxxxxForm.submit();
}
--------------------------------------------------------

Well... to sum up... what I'm trying to say is that your grid is almost perfect and what it needs to be perfect is this.
Why don't you try to do a 2.0 version with this feature.


Thanks for all...

Diego Souto - Spain -
Diego Souto
Thursday, March 10, 2005



This topic is archived.

Back to support forum

Forum search