1. #1
    Ext User
    Join Date
    Sep 2008
    Posts
    20
    Vote Rating
    0
    gianpaulo is on a distinguished road

      0  

    Default Ext.Direct and Grid Paging, no parameters passed.

    Ext.Direct and Grid Paging, no parameters passed.


    I tried the solution on this thread http://www.extjs.com/forum/showthrea...ht=grid+paging but still no luck.

    The PagingToolbar correctly displays the number of pages and records but when I clicked on next page, I saw on Firebug that no paging parameters are being passed. Why is that?

    I'm using paramsAsHash: false, so I added the paramOrder property to the store's config. But now the grid won't get populated.

    Here's my code:

    Code:
    HRIS.TimekeepingGrid = Ext.extend(Ext.grid.GridPanel,{
        initComponent:function(){
            otstore = new Ext.data.DirectStore({
                directFn: HRIS.Overtime.index,
                root:'data',
                paramsAsHash: false,
                fields:[
                   'id','reference_no','time_start'
                ],
                idProperty:'id',
                totalProperty:'total',
                sortInfo:{
                    field:'id',
                    direction:'ASC'
                },
                paramNames:{
                    start:'start',
                    limit:'limit',
                    sort:'sort',
                    dir:'dir'
                },
                paramOrder:'start|limit|sort|dir'
    
            });
            Ext.apply(this,{
                width:500,
                height:300,
                store:otstore,
                bbar:new Ext.PagingToolbar({
                    pageSize:25,
                    store:otstore,
                    displayInfo:true
    
                }),
                cm:new Ext.grid.ColumnModel([
                    new Ext.grid.RowNumberer(),
    
                    {dataIndex:'id',header:'ID'},
                    {dataIndex:'reference_no',header:'Reference No.'},
                    {dataIndex:'time_start',header:'Time Start'}
                ])
                });
    
            HRIS.TimekeepingGrid.superclass.initComponent.apply(this,arguments);
            this.getStore().load({
                        params: {
                start: 0,
                limit: 10
            }
            });
    I also tried using the PagingDirectStore but I can't get the grid populated.

    A little help would be appreciated.

  2. #2
    Ext User
    Join Date
    Sep 2008
    Posts
    20
    Vote Rating
    0
    gianpaulo is on a distinguished road

      0  

    Default


    I really hoped someone could help me. I upgraded to 3.0.3 and the grid is being populated even without the paramsAsHash:false option. But still, the paging parameters (start&limit) are not being passed.

    Could someone from the ExtJS team answer if Grid Paging using Ext.Direct is not possible so I can just use the traditional Store.

  3. #3
    Ext User
    Join Date
    Sep 2008
    Posts
    20
    Vote Rating
    0
    gianpaulo is on a distinguished road

      0  

    Default


    Wow. A lot of views but still no answer. I'm I really the only one having this issue? Can anyone show me a working Ext.Direct w/ GridPanel + Paging?

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    82
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Is the directFn in your API configured to have len:4?

    ps. PagingDirectStore would do local paging, so it doesn't send start and limit parameters and expects all records in response.

  5. #5
    Ext User
    Join Date
    Sep 2008
    Posts
    20
    Vote Rating
    0
    gianpaulo is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Is the directFn in your API configured to have len:4?

    ps. PagingDirectStore would do local paging, so it doesn't send start and limit parameters and expects all records in response.
    Wow. Why haven't I thought of that? Works now. Thanks Condor!

    I think this should be included in the docs. That paging parameters should be included defined in the server side method.

  6. #6
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    what format should have the data sent by server for a grid with paging toolbar? is this one ok ? :
    Code:
    {
    "type": "rpc",
    "tid": 2,
    "action": "DirectReport",
    "method": "GetReports",
    "result": {
        "total": 1,
        "data": [{},{},{}]
    }

Thread Participants: 2