0

I have a grid wich store is a QueryReadStore. It works fine, even the virtual scrolling. The problem is the filter, when I filter, it generates a strange URL like this:

http://mydomain:8080/project=%3F&1=f&2=i&3=l&4=t&5=e&6=r&7=......

And I want to looks like this:

http://localhost:8080/project?filter={%22op%22:%22contains%22,%22data%22:[{%22op%22:%22string%22,%22data%22:%22username%22,%22isCol%22:true},{%22op%22:%22string%22,%22data%22:%22s%22,%22isCol%22:false}]}

Here is the code that generates the grid and the filter:

this.grid = new EnhancedGrid({ 
                store: null,
                structure: this.columns,         
                rowsPerPage: 20, 
                autoHeight: false, 
                plugins: {
                    filter: {
                        closeFilterbarButton: false,
                        isServerSide: true,
                        setupFilterQuery: dojo.hitch(this, function(commands, request){
                          if(commands.filter && commands.enable){
                              var gridStoreURL = this.grid.store.url;

                              if(gridStoreURL.indexOf("?") > -1) {
                                request.query = "&filter=" + JSON.stringify(commands.filter);
                              } else {
                                request.query = "?filter=" + JSON.stringify(commands.filter);
                              }
                          }else{
                          }
                        }),
                        ruleCount: 3,
                        itemsName: "logs",
                        disabledConditions: {anycolumn : this.disabledFilterAnyColumn}
                    }
                }
            }, this.idGridContainer);

I create the store with this function:

var store = dojox.data.QueryReadStore({
                url : this.urlBase + agentId,
                requestMethod:"get"
            });

            this.grid.setStore(store, null, null);

When I use JsonStore to create the store, the filter works fine, but with this doesn't.

Thank you in advance

1 Answer 1

1

You appear to be attempting to set the store query to a string, but IIRC QueryReadStore only ever expects the query to be passed as an object, as opposed to JsonRestStore which can accept it either way.

Try something like this instead, for starters, and see if it gets you further:

request.query = { filter: JSON.stringify(commands.filter) }
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.