Results 1 to 5 of 5

Thread: loader issue

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default loader issue

    Hello

    something which is baffling me.
    I have the following tabpanel
    Code:
            var tabA = Ext.createWidget('tabpanel', {
            renderTo: 'tabA',
            activeTab: 0,
            width: 600,
            height: 250,
            plain: true,
            defaults :{
                autoScroll: true,
                bodyPadding: 10
            },
            items: [{
                    title: 'AAA',
                    loader: {
                        url: 'myfile.php',
                        loadMask: true
                    },
                    listeners: {
                        activate: function(tab) {
                            tab.loader.load();
                        }
                    }
                },{
                    title: 'BBB',
                    loader: {
                        url: 'myfile.php', 
                        autoLoad: true,
                        params: 'par=B'
                    }
                }, {
                    title: 'CCC',
                    loader: {
                        url: 'myfile.php',
                        autoLoad: true,
                        params: 'par=C'
                    }
                }
            ]
        });
    If I return $POST, I get either
    Code:
     Array ( [0] => p [1] => a [2] => r  [3] => = [4] => B )
    or
    Code:
     Array ( [0] => p [1] => a [2] => r  [3] => = [4] => C )
    (instead of
    Code:
    Array ( [par] => B) or Array ( [par] => C)
    What do I do wrong?
    help is very appreciate
    thks
    mario

    ps. I get what I need by using
    Code:
    loader: {
                        url: 'myfile.php?par=B', 
                        autoLoad: true
                    }
    still it could be useful to use params.
    Last edited by mario60; 8 Jan 2012 at 12:14 PM. Reason: ps.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,385
    Vote Rating
    1540
      0  

    Default

    I would use params like this:

    Code:
    params : {
        p : 0,
        q : 1
    }
    If it is a GET request then they should be url encoded and appended to the url.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default nope

    Code:
    params: '{par : AA}'
    is not working for me.
    thks anyway
    m.

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,385
    Vote Rating
    1540
      0  

    Default

    You are once again passing a string. My code was an Object.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Posts
    29
    Vote Rating
    0
      0  

    Default I see, thks so much

    I see your point now:
    Code:
    params : { par : 'AA' }
    works!

    thanks so much
    mario

    ps
    Code:
    params : { par : AA }
    does not work; 'AA' is still a string, of course!

Posting Permissions

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