Frage

I have a problem with flexigrid. When the page loads first, it runs a query. Then, when I (1)change the sort order, or (2)go to the next page, it runs a new query(with different parameters), which is slow.

I'd like to make it faster. I know that, when we load the page, the result of the query goes into a php array. Is it possible to keep this array(maybe put it in a json array), and when we want to do (1) or (2), we just have to modify this array, and refresh the grid? How can I implement this?

Thanks for your help!

War es hilfreich?

Lösung

You can load first time data in a json object using an ajax request then in success callback function of this request load data to flexigrid using this json object. But the first ajax request will need all the data from database (db request). So all your user, even then need just first ten rows, will download from your server all the data each time they go to your flexigrid web page, which is not a good way to go. But its depends if you have 20 rows in your data table or let's say 100000...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top