1. #1
    Ext User
    Join Date
    Dec 2010
    Posts
    6
    Vote Rating
    0
    sourcepond is on a distinguished road

      0  

    Default Zend Framework getRequest and JSONStore start/limit params

    Zend Framework getRequest and JSONStore start/limit params


    Hi All,

    Has anyone had any experience trying to paginate a datagrid, when the URL for a JSON store is to a ZF action?

    The problem I have. ExtJs from what I have read sends ?start=x&limit=y

    I can't seem to figure out how to get Zend to interpret that type of query, and was hoping there was a way to format the JSONStore param sting to set the url with /start/x/limit/y

    Is this possible, or how can I use the existing way ExtJS posts the request with Zend?

  2. #2
    Sencha User
    Join Date
    Oct 2007
    Location
    Iran
    Posts
    159
    Vote Rating
    0
    vahid4134 is on a distinguished road

      0  

    Default


    in request object you can use getParam method
    in action object you can use _getParam method
    No honor is like knowledge

  3. #3
    Ext User
    Join Date
    Dec 2010
    Posts
    6
    Vote Rating
    0
    sourcepond is on a distinguished road

      0  

    Default


    Hi Vahid,

    I know about the getParam method. However, when ExtJS sends the request it uses ?start=x&limit=y, and I have no idea how to fetch that from getParam, as it is expecting something like /start/x/limit/y OR x/y - it's the way the string is sent to the framework that I'm unsure how to process.

    Any pointers would be great. Cheers for the response.

    Regards,
    PS

  4. #4
    Sencha User
    Join Date
    Jan 2010
    Posts
    65
    Vote Rating
    0
    Aero is on a distinguished road

      0  

    Default


    Hi,

    Sounds like you need to change the ordinary Ext-HTTP/url-encode for encoding the params differently,which is what the store(which Jsonstore extends) uses. Can be done in the ext class i think,replacing & to /. I haven't done it myself. Also might affect many other function?

    Cheers.

  5. #5
    Sencha User
    Join Date
    Oct 2007
    Location
    Iran
    Posts
    159
    Vote Rating
    0
    vahid4134 is on a distinguished road

      0  

    Default


    Why dont use POST OR GET param?
    this is simple code for get json result fo extjs grid with limit for paginator in action method

    PHP Code:
        $start$this->_getParam("start",0);
        
    $limit$this->_getParam("limit",20);
        
        
    $paginator= new Zend_Paginator_Adapter_DbTableSelect($select);
        
        
    $json["success"]=true;
        
    $json["total"]=$paginator->count();
        
    $json["rows"]=$paginator->getItems($start,$limit)->toArray(); 
    Last edited by vahid4134; 22 Dec 2010 at 11:38 PM. Reason: mistake
    No honor is like knowledge

  6. #6
    Sencha User
    Join Date
    Oct 2007
    Location
    Iran
    Posts
    159
    Vote Rating
    0
    vahid4134 is on a distinguished road

      0  

    Default


    _getParam get parameter from get post request and standard router URL
    No honor is like knowledge

Similar Threads

  1. Grid Pagination Using Different Params for start and limit
    By tpouyer in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 29 Nov 2011, 1:44 AM
  2. }がload時の {params: {start: 0, limit: 20}ききません
    By fudaozhenchu@gmail.com in forum Japanese Sencha Forum
    Replies: 8
    Last Post: 4 Apr 2011, 6:14 AM
  3. Pagingtoolbar does not send start and limit params to sever
    By jimtyp in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Oct 2009, 12:13 PM
  4. XMLReader - start and limit params
    By ka3S in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 6 Feb 2008, 8:05 AM
  5. [Solved] dataStore.load({params:{start:0, limit:25}});
    By cluettr in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 27 Jun 2007, 11:09 AM

Thread Participants: 2

Tags for this Thread