0

im trying to get my flexigrid to sort its columns in the browser and not on the server. i have a static XML file that is loaded into the grid and displays exactly how i want... the thing is flexigrid doesnt sort the table as it is working from a local data file.

i have found a few 'extentions' to the original code but i cant seem to get them to work.. this one in particular seemed promising.. http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/comment-page-1/#comment-10498

there is also this solution but it kept breaking my table completely.. https://groups.google.com/forum/?fromgroups#!topic/flexigrid/VJTp5GP0sc4

so my question still remains.. how can i sort in the browser using the lovely flexigrid ? i really want to move away from using flash searchable datagrids as these dont show in ios products..

look forward to hearing back!

xx

Timmy Lee
  • 785
  • 1
  • 11
  • 25

3 Answers3

0

I looked in the source and found, that flexgrid doesn't sort the data. When you change the order of any column, it sends Ajax request to the server with parameters "sortname" and "sortorder" and after that refreshes table with received data.

mvb13
  • 1,514
  • 3
  • 18
  • 33
0

I solved it reloading flexigrid in the parameter onChangeSort:

$(your_flexigrid).flexigrid({
    ...,
    onChangeSort: function(){
        $(your_flexigrid).flexReload();
    },
    ...
});

Also pay attention to name of flexigrid's columns. They must have the same name that columns of the tables or views which will be attacked.

Vegekku
  • 1
  • 2
-1

We implemented local sorting in flexigrid but it's far from perfect. We used the info from here:

http://www.onemoretake.com/2009/02/25/sorting-elements-with-jquery/

I'd look here too:

http://pixelnix.com/flexigrid-jquery-plugin-extending-to-allow-sorting-of-static-grids/

Corey
  • 279
  • 3
  • 2