EnhancedGrid Filter plugin : ServerSide Stateful

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

EnhancedGrid Filter plugin : ServerSide Stateful

ACCA
Hi people,

I cannot find anything in the docs or examples on the server-side response on `url' call from Filter plugin. It certainly not ignored - if I reply with a HTTP header without body, the grid is blank. Returning something like 'OK' partially works, but this is a kind of a hack in the dark.

With "OK" response there is only the first "page" (0-24/30000) being displayed. An attempt to scroll further blanks the grid. Any tip is greatly appreciated.

http://server.address/grid/data returns JSON with proper Content-range:, the grid is perfectly populated without filter plugin.
http://server.address/grid/filter currently returns "OK". Content-range: for /grid/filter is not set.

dojo.ready(function(){
    var grid_data_store = new dojox.data.JsonRestStore({
        id: 'grid_data_store',
        idAttribute: 'wireless.alarm_num',
        target: '/grid/data'
    });

    var grid_layout = [
        { field: 'wireless.alarm_num', datatype: 'string', name: 'Alarm number',
          width: '24em', height: '1em'
        },
        { field: 'wireless.ecode', datatype: 'string', name: 'Ecode',
          width: '10em', height: '1em'
        },
        { field: 'wireless.note', datatype: 'string', name: 'Service record notes',
          width: '20em', height: '1em' 
        },
        { field: 'wireless.message', datatype: 'string', name: 'Log messages',
          width: 'auto', height: '1em' 
        }
    ];

    var grid_grid = new dojox.grid.EnhancedGrid({
        id: 'data_grid_main',
        store: grid_data_store,
        rowSelector: '1em',
        structure: grid_layout,
        clientSort: false,
        plugins: {
            filter: {
            	isServerSide: true,
            	isStateful: true,
            	url: '/grid/filter'
            },
            nestedSorting: true
        }
     },
     document.createElement('div'));

    dojo.byId("grid_container").appendChild(grid_grid.domNode);
    grid_grid.startup();
});
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EnhancedGrid Filter plugin : ServerSide Stateful

zhuxw
Hi,

The response should be something like: "200,1000".
The first number is the count of filtered rows. The second is the total number of rows in the store.

Best Regards.
-------------
Oliver
Best Regards
-------------
Oliver
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EnhancedGrid Filter plugin : ServerSide Stateful

ACCA
zhuxw wrote
The response should be something like: "200,1000".
The first number is the count of filtered rows. The second is the total number of rows in the store.
got it. Thus if I have `url' omitted and EnhancedGrid defaults to the store's `target' with filtering queries, the RESTful `target' must distinguish between GET requests for data and POST requests with filter queries and produce corresponding replies.

Sounds like we have a good paragraph for API Reference Guide.

Many thanks, Oliver!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EnhancedGrid Filter plugin : ServerSide Stateful

zhuxw
You are welcome :-)
Still curious about why using Stateful for JsonRestStore? Why not stateless by default?

Best Regards
--------------------
Oliver

On Wed, Aug 10, 2011 at 7:11 PM, ACCA [via Dojo Toolkit] <[hidden email]> wrote:
zhuxw wrote:
The response should be something like: "200,1000".
The first number is the count of filtered rows. The second is the total number of rows in the store.
got it. Thus if I have `url' omitted and EnhancedGrid defaults to the store's `target' with filtering queries, the RESTful `target' must distinguish between GET requests for data and POST requests with filter queries and produce corresponding replies.

Sounds like we have a good paragraph for API Reference Guide.

Many thanks, Oliver!



If you reply to this email, your message will be added to the discussion below:
http://dojo-toolkit.33424.n3.nabble.com/EnhancedGrid-Filter-plugin-ServerSide-Stateful-tp3240189p3242187.html
To unsubscribe from EnhancedGrid Filter plugin : ServerSide Stateful, click here.

Best Regards
-------------
Oliver
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: EnhancedGrid Filter plugin : ServerSide Stateful

shv22
This post has NOT been accepted by the mailing list yet.
In reply to this post by ACCA
Is there a need of server side scripting when using stateful server side filtering? Can you post any example for the same. Can't we use setupFilterQuery for the same?
Loading...