1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    kaolin1k is on a distinguished road

      0  

    Exclamation Unanswered: Loader - dynamically use the params for the URL

    Unanswered: Loader - dynamically use the params for the URL


    Hello,

    I am new in the filed ExtJs 4 , I tried the new feature loader like in the example from SENCHA docs


    newExt.Component({
    tpl:'{firstName} - {lastName}',
    loader:{
    url
    :'myPage.php',
    renderer
    :'data',
    params:
    {
    userId
    :111111
    }
    }});

    Where is my problem, how do you pass dynamically this userId ?
    Here is my small sample, in this case userId is id.....


    initComponent: function() {
    this.items = this.createComponent( this.id);
    this.callParent(arguments);
    ///// here I have the value of the ID with this.id but in the loader nooooooo
    },



    loader: {
    url: Context.getContextRoot() + 'extjs4/test/testLoader.json',
    params: {
    //CHANGE DYNAMIC THE ID
    id: 10402 //// <<<<<<<<<<<<<<here is the plase

    //I cant use like this.id

    },
    autoLoad: true,
    renderer: function (loader, response, active) {
    var actions= Ext.decode(response. responseText);
    loader.target.root. testStore.add( actions);
    //loader.target.update();
    loader.target.root.down('test_ TestLoaderToolbar').update();
    return true;
    }

    },



    Thank you in advace !

    Best regards kaolin1k;

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    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


    You want to use this.id? You need to set the params in the initComponent but not use autoLoad:

    Code:
    initComponent: function() {
        this.loader.params : {
            userId : this.id
        };
    
        this.loader.load();
    
        this.callParent(arguments);
    }
    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
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    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


    Aldo, please use the BBCode code tags (in the toolbar) and post into the appropriate forum. I have moved this thread for you.
    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.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar