ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: daan on September 30, 2014, 12:41:35 pm

Title: Table with remote loading/paging/sorting/filtering
Post by: daan on September 30, 2014, 12:41:35 pm
Is it possible to have a HTML-table and convert it to a grid and still have all the remote functionality? That includes paging, sorting and filtering the grid. I can't find any such demo, only the one about converting a table to a grid and then use local paging in it.
Title: Re: Table with remote loading/paging/sorting/filtering
Post by: paramvir on September 30, 2014, 02:01:06 pm
It can be done but I don't see any point in this unless I'm missing something.

If you can send JSON data (filtered, sorted, etc ) from server why would you create HTML table in first place.
Title: Re: Table with remote loading/paging/sorting/filtering
Post by: daan on September 30, 2014, 02:50:07 pm
I totally agree with you, but unfortunately it's a requirement we have. The page have to work without JS and then show a basic table instead. Because of that everything has to be built in an html-table and then if possible converted to a grid for those users that has javascript enabled.
Your example on how to convert a table to a grid is good, but the grid doesn't have remote paging, filtering and all the other nice features of a grid.
I think it will create a lot of extra work for us, but I just wanted to know if it's something you've encountered before.
Title: Re: Table with remote loading/paging/sorting/filtering
Post by: paramvir on October 01, 2014, 10:24:31 pm
When HTML table is converted into a grid, table's content/data stored in cells is copied to an array of arrays. So the grid behaves like any other grid with all features but with array data.

In order to integrate it with remote sorting, filtering, paging etc you would need to map the array data to JSON data with $.map or by using 2 for loops.