Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    64
    Vote Rating
    6
    jim@carroll.net is on a distinguished road

      2  

    Default How to set pageParam to undefined using Architect?

    How to set pageParam to undefined using Architect?


    Working with Ext.data.proxy.Ajax, we'd like to disable the 'page' URL parameter. According to the docs we need to set pageParam to undefined, but we can't figure out how to accomplish this using Architect. Entering the word undefined in the value field of the configuration panel results in the pageParam being set to a quoted string 'undefined'.

    I understand we could just fire up and editor and directly change the .js file, but that gets overwritten by all subsequent save operations from within Architect.

    (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.proxy.Server-cfg-pageParam).

  2. #2
    Sencha User jojopad's Avatar
    Join Date
    Aug 2012
    Location
    Manila, Philippines
    Posts
    6
    Vote Rating
    3
    jojopad is on a distinguished road

      2  

    Default


    Here's my workaround on how to set the pageParam property to undefined.

    1. Add a "beforeload" event binding to the store object.
    2. Inside the beforeload function:

    store.proxy.pageParam = undefined;
    store.proxy.limitParam = undefined;
    store.proxy.startParam = undefined;

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    2
    Vote Rating
    0
    dominik.gierse@hst.de is on a distinguished road

      0  

    Default


    Hi!

    Sorry, but this didn't work for me!
    Is there another possibility to turn of the parameters?

    Here's my generated code:

    Code:
    Ext.define('Example.store.EmployeeStore', {
        extend: 'Ext.data.Store',
    
        requires: [
            'Example.model.Employee'
        ],
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                autoLoad: true,
                model: 'Example.model.Employee',
                storeId: 'MyJsonPStore',
                proxy: {
                    type: 'jsonp',
                    noCache: false,
                    pageParam: 'undefined',
                    url: 'http://localhost/ExampleService/tester',
                    reader: {
                        type: 'json'
                    }
                },
                listeners: {
                    beforeload: {
                        fn: me.onJsonpstoreBeforeLoad,
                        scope: me
                    }
                }
            }, cfg)]);
        },
    
        onJsonpstoreBeforeLoad: function(store, operation, eOpts) {
            store.proxy.pageParam = undefined;
            store.proxy.limitParam = undefined;
            store.proxy.startParam = undefined;
            store.proxy.callback = undefined;
        }
    
    });
    Edit:
    even if i change the service to receive the Params like
    Code:
    [OperationContract]
            [WebGet(
                BodyStyle = WebMessageBodyStyle.Bare,
                ResponseFormat = WebMessageFormat.Json,
                RequestFormat = WebMessageFormat.Json,
                UriTemplate = "tester?page={page}&start={start}&limit={limit}&callback={callback}"
                )]
            Employee tester(string page, string start, string limit, string callback);
    i get an "Uncaught SyntaxError: Unexpected token :"


    what i'm doing wrong?

    thanks and regards

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi