1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Shanghai, China
    Posts
    21
    Answers
    1
    Vote Rating
    1
    tianhao is on a distinguished road

      0  

    Default Unanswered: how to pass a parameter through ajax

    Unanswered: how to pass a parameter through ajax


    hi all,
    i have finished an ajax grid. it works good. here is the code:
    xtype: 'gridpanel',
    id: 'mygrid',
    ......
    store: Ext.create('Ext.data.Store',{proxy: {type: 'ajax',url: 'duty.json.ajax.php',reader: {...}}})
    this is ok. but when i add a parameter to url of proxy, it doesnt work. i replace url with
    url: 'duty.json.ajax.php?id='+Ext.getCmp('id').getValue()
    the web console of firefox said
    TypeError: Ext.getCmp("id") is undefined
    and nothing was displayed.
    plz help me.

  2. #2
    Sencha User mixo's Avatar
    Join Date
    Jul 2011
    Location
    Novosibirsk
    Posts
    43
    Answers
    4
    Vote Rating
    3
    mixo is on a distinguished road

      0  

    Default


    hello

    I guess your problem not in ajax. what you expect to get by Ext.getCmp('id').getValue()?
    First step is try manually get this value by typing in console Ext.getCmp('id').getValue().

    I think there is bad style use an ID of cmp, if it's possible better access to cmp is call for parent cmp like this

    Code:
    cmp = parent_cmp.down('[name=cmpName]')

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Shanghai, China
    Posts
    21
    Answers
    1
    Vote Rating
    1
    tianhao is on a distinguished road

      0  

    Default


    it didnot work
    console prompted ok when i run Ext.getCmp('id').getValue(). the result is 4. that is right.
    any help will be appreciated.

  4. #4
    Sencha User mixo's Avatar
    Join Date
    Jul 2011
    Location
    Novosibirsk
    Posts
    43
    Answers
    4
    Vote Rating
    3
    mixo is on a distinguished road

      0  

    Default


    Strip calculate url and ajax request


    Code:
    myUrl = 'duty.json.ajax.php?id='+Ext.getCmp('id').getValue()
    console.log(myUrl);
    ...
    url: myUrl

  5. #5
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    You can also do this:

    Code:
    yourGrid.getStore().load({
      params: {
        someParam: 'someValue'
      }
    });

Thread Participants: 2

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..."