1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    6
    Answers
    1
    Vote Rating
    0
    iooK is on a distinguished road

      0  

    Default Unanswered: Store rebuid url with parameters

    Unanswered: Store rebuid url with parameters


    Hello all,

    I want to retrieve all parameters of a store to recreate my own uri.
    Please take a look of my store :
    Code:
    Ext.define('app.store.listeArticleStore', {
        extend: 'Ext.data.Store',
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                storeId: 'listeArticleStore',
                remoteFilter: true,
                remoteSort: true,
                pageSize: 50,
                proxy: {
                    type: 'ajax',
                    pageParam: 'p',
                    url: '/XmlView/ListeArticle',
                    reader: {
                        type: 'xml',
                        idProperty: 'ART_ID',
                        totalProperty: 'totalProperty',
                        record: 'row'
                    }
                },
                fields: [
                    {mapping: 'ART_ID', name: 'ART_ID', type: 'int'},
                    {mapping: 'ART_LIBELLE', name: 'v_art_articles_formats.art_libelle', type: 'string'},
                    {mapping: 'ART_CODE_ALTIUS', name: 'v_art_articles_formats.art_code_altius', type: 'string'},
                    {mapping: 'ART_MILLESIME', name: 'v_art_articles_formats.art_millesime', type: 'string'},
                    {mapping: 'ART_AGE', name: 'v_art_articles_formats.art_age', type: 'string'},
                    {mapping: 'FOR_CL', name: 'v_art_articles_formats.for_cl', type: 'string'},
                    {mapping: 'STOCK_PANIERS', name: 'v_art_stock_paniers.stock_paniers', type: 'int'},
                    {mapping: 'STOCK_RAYON', name: 'v_art_stock_rayon.stock_rayon', type: 'int'},
                    {mapping: 'STOCK_RESERVE', name: 'v_art_stock_reserve.stock_reserve', type: 'int'},
                    {mapping: 'STOCK_TOTAL', name: 'v_art_stock_total.stock_total', type: 'int'},
                    {mapping: 'PRO_ID', name: 'PRO_ID', type: 'int'},
                    {mapping: 'ART_EN_LIGNE', name: 'ART_EN_LIGNE', type: 'boolean'}
                ]
            }, cfg)]);
        }
    });
    Url is '/XmlView/ListeArticle', when this store is called, plenty of parameters are sent with it (thanks to POST method).
    The page parameter named 'p' or a user search named 'my_search' in my application, ....

    I would like to rebuild a uri with this parameters thanks to GET method like this example '/XmlView/ListeArticle?p=1&limit=25&my_search=wine&...'
    I want to do this to create an excel extract with the same parameters of my gridpanel.

    Thanks in advance.

    nb: Sorry for my poor english.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Why are you trying to create your own url? THe url can be built auto for you and you can change the param names
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    St Louis,MO
    Posts
    267
    Answers
    20
    Vote Rating
    18
    James Goddard will become famous soon enough James Goddard will become famous soon enough

      0  

    Default


    What he is trying to do is call a different service based on the parameters the store is using.

    For example, if he fills his store with:

    /xyz/?page=X&start=Y&limit=Z&sort=field1&dir=ASC

    He wants to call an Excel export service with the same paremters (probably from an iframe so he can download the excel file without replacing his workspace):

    /xyz/export/?page=X&start=Y&limit=Z&sort=field1&dir=ASC&format=excel


    To do this you're going to need to do a little work on your own. There is no "store.getParams" function. First if you look at the load function on store you'll see:

    Code:
            options.groupers = options.groupers ||  me.groupers.items;
            options.page = options.page || me.currentPage;
            options.start = (options.start !== undefined) ? options.start : (options.page - 1) * me.pageSize;
            options.limit = options.limit || me.pageSize;
            options.addRecords = options.addRecords || false;
    That should show you where to get grouping and paging params. The filters and sorters come from the AbstractStore load function:

    Code:
            options = Ext.apply({
                action: 'read',
                filters: me.filters.items,
                sorters: me.getSorters()
            }, options);
    With those you should be able to build an object with the appropriate properties. From there a simple Ext.Object.toQueryString should do.

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