Results 1 to 9 of 9

Thread: limit in Store requests always 25.

  1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    183

    Default limit in Store requests always 25.

    I Post question in the Help forum. Maybe it is a bug so I post it too Bugs.
    Maybe this helps to get a response anyway.

    Maybe I forgotten something to do. All requests for loading a store are send with param limit=25. If I configure in extraParams a param limit: 9999 seems to be overruled. If I remove the param limit: 9999 in my extraparams Sencha-touch still adds a param limit=25.

    Is there somewhere a default overruling param for limit??

    Here is some debug report. Watch the limit=25 in the request.

    Code:
    Javascript:
    	this.servincidentStore = new Ext.data.Store({
    		model: 'Incident',
    		storeId: 'incident',
    		proxy: {
    			type: 'ajax',
    			url: '/generator-grid/BackendGrid/incidentGridBackend.php',
    			method: 'POST',
    			extraParams: {
    				mobile: true,
    				start: 0,
    				limit: 9999,
    				userProfielId: profielid,
    				task: 'LISTING',
    				xvelden: ', incident.PersoonId ',
    				sort: 'incident.Incident',
    				dir: 'ASC'
    			},
    			reader: {
    				type: 'json',
    				root: 'results'
    			}
    		}
    	});
    
    Debug info:
    
    Verzoek-URL:http://localhost/generator-grid/BackendGrid/incidentGridBackend.php?_dc=1295089977116&mobile=true&start=0&limit=25&userProfielId=791&task=LISTING&xvelden=%2C%20incident.PersoonId%20&sort=incident.Incident&dir=ASC
    Verzoekmethode:GET
    Statuscode:200 OK
    Vraagkopteksten

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395

    Default

    Hi pcr.
    This is not a bug, I thought it too, but take a look at this post to know how to configure your store.

    http://www.sencha.com/forum/showthre...ot-param-issue

    Hope this helps.

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    183

    Default

    Hi Andrea,

    Thank you very much. This works. Now the stores are requested with method: 'POST'.
    Now I still have that weird feature about limit is always 25. if the method: 'POST' it's the same. limit always send as 25???

    Do you have such a nice solution like this??

    thanks

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    did you set the pageSize param?

    Code:
    new Ext.data.Store({
       ...
        pageSize: 100,
        ...
    })
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  5. #5
    Sencha User
    Join Date
    Jun 2009
    Posts
    183

    Default

    Hi Mitchell,

    Thats was the problem. pageSize is new to me. Probably it's part of a new strategy for paging.

    I expect that the data->proxy-> reader concept of Sencha will be the new strategy for ExrJS 4.0 as well.

    It would be great if some Sencha guru make a FAQ for ExtJS to Sencha people.


    Thank you for your help.

  6. #6
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    For the most part, Sencha Touch is the same as ExtJS. Sure there are differences but that's where you just need to spend time reading the Docs (found the pageSize param in the Docs under Store -> public properties) and the actual source. I spend everyday looking at the Docs, I remember a lot of it but everyone still looks to make sure they are sure about what it is they need to do.

    And the "Sencha guru"s look at the source a lot. This will do 2 things: let you know how things work which will let you know how to do something and it will also, hopefully, show you a better way to code.

    For instance, I made my TouchGridPanel by reading code from ExtJS. This told me exactly how things work in ExtJS.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  7. #7
    Sencha User
    Join Date
    Jun 2009
    Posts
    183

    Default

    Thanks again. Very clear. I wasn't aware of so much differences between ExtJS en Sencha-touch. I got response from Ed SPencer in another thread with the same issue. He confirmed ExtJS data package will be the same as the data package in Sencha touch.

    A small problem is I want to use the same backend PHP scripts build for ExtJS. Thanks God now they do without changes.

    BTW he said make pageSize: undedined makes skipping the limit: 25 (default) completely.

    From now on I know to read the docs more as I allready did.

  8. #8
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    I would warn you one thing and I have seen apps and devs do this time after time... Mobile devices are starting to get really powerful but you should still think about performance of you app. In ExtJS, it's fine to have 100 rows in a grid and do other things but in Sencha Touch, the device may not be able to handle 100 rows. This is why paging is turned on by default. You can make your PHP scripts look for the paging params and use them if present. If not, then do not page.

    I would highly recommend that you use paging in Sencha Touch (and ExtJS for that matter but not needed as much).
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  9. #9
    Sencha User
    Join Date
    Jun 2009
    Posts
    183

    Default

    I'm Ok with that. Even in ExtJS I use paging if the selected records can be large. My strategy for mobile devices is to make a choice to pre-load small (lookup)stores and use filters or everytime I need another selection reload the store from the server with other parameters. A lot of mobiles are not connected with wifi but with a public network with restricted plans. So loading is slow, time-consuming and expensive. I inspected some online apps and saw some are load some kb of data (like pictures) to work with.
    Ok I agree we have to be carefull with loading much data and test test test

    Do you know how much loaded data Safari in iPad able to handle???

Similar Threads

  1. default data.store limit value
    By phyton in forum Ext 3.x: Help & Discussion
    Replies: 21
    Last Post: 22 Jul 2014, 1:39 PM
  2. request store always sent with param limit=25??
    By pcr in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 14 Jan 2011, 3:05 AM
  3. What is the limit (No of Records) of Grouping Store
    By surendra.manchikanti in forum Sencha Ext JS Q&A
    Replies: 2
    Last Post: 1 Nov 2010, 12:05 AM
  4. Managing HTTP Requests on Stores, TreeLoaders and Ajax Requests
    By j-joey in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 14 Jun 2010, 11:32 PM
  5. Store: Using different parameter names for 'limit' and 'start'
    By marceloverdijk in forum Ext 1.x: Help & Discussion
    Replies: 11
    Last Post: 18 May 2007, 6:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •