views:

234

answers:

0

I am having hard time filtering a datagrid. Please help!

This is how I draw a grid.

    var jsonStore = new dojo.data.ItemFileWriteStore({data:columnValues});

    gridInfo = {
              store: jsonStore,
              queryOptions: {ignoreCase: true},
              structure: layout
           };

    grid = new dojox.grid.DataGrid(gridInfo, "gridNode");
    grid.startup();

Now if i try something like this, it works fine and gives me the rows which has the column (AGE_FROM) value equal to 63. grid.filter({AGE_FROM:63});

but I need all kinds of filtering and not just 'equal to'

So how do I try to obtain all the rows which have AGE_FROM > 63, and < 63 and <= 63 and >=63. because grid.filter({AGE_FROM:<63}); does not work

Also One other way I was thingking was to use the following filteredStore = new dojox.jsonPath.query(filterData,"[?(@.AGE_FROM >= 63]");

and then draw the grid with the filteredStore, but the above is not working for a != operator. Once I figure a good way to filter grid I need to see a way to filter out dates.

I am trying to find a good example for filtering dataGrid but most of the examples are just filtering based on the 'equal to' criteria.

Any help is highly appreciated.