grid + paging + smart rendering

We use professionell version of grid with paging and smart rendering with xml loading.



first request:

url = someUrl



responding xml:

<?xml version="1.0" encoding="UTF-8"?>



some header

10 rows





-> first page will be correct displayed



klick to second page:

url = someUrl?posStart=10&count=10



responding xml:

<?xml version="1.0" encoding="UTF-8"?>



some header

next 10 rows





-> paging goes back to page one and shows: datasets 1 to 0 from 65



what is wrong?

When XML contains header section ("…") , grid fully reset its configuration based on data from header, which result in not-expected behavior in your case.
Just user pure data, without head section for loading additional paging data

url = someUrl?posStart=10&count=10
responding xml:
<?xml version="1.0" encoding="UTF-8"?>

next 10 rows


By the way, you need total_count attribute for first xml only, can be skiped for next loadings

Ok, this works now.

In this environment we will enabling server side filtering.

I use following code:

            grid.attachEvent(“onFilterStart”, function (colIds, values) {              
                grid.clearAll();
                var filterUrl = …;     
                grid.loadXML(filterUrl, function () {
                });
               
                return false;
            });

the filtering works, but filter values are removed from filter fields in header

Can i prevent this?

the issue can occur when

a) you still contain “head” section in XML loaded after filter applied. ( in such case grid will be reset, which will result in header recreation and lost of previous filters as result )

b) if you are using #select_filter, grid will try to reload them from new data loaded, which may result in lost of previously selected value.
You can try to modify your code as

grid.attachEvent(“onFilterStart”, function (colIds, values) {
grid.refreshFilters=function(){} //will block filter list refreshing functionality
grid.clearAll();
var filterUrl = …;
grid.loadXML(filterUrl, function () {
});

return false;
});