1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    29
    Vote Rating
    0
    nmohan.025 is on a distinguished road

      0  

    Default regarding passing parameters

    regarding passing parameters


    hi.........
    i'am doing search according to the alphabeticals..i placed all the letters on panel toolbar.now i want to send the button text value to the backend file... how can i send..
    any one knows the solution help me

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    So you want something like:
    Code:
    {
      xtype: 'button'
      text: 'A',
      handler: function(){
        store.load({params: {filter: 'A'}});
      }
    }

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    29
    Vote Rating
    0
    nmohan.025 is on a distinguished road

      0  

    Default regarding search

    regarding search


    i have written a factory function to print alphabets and added togglehandler to it: i want the store to load on click of the particular albhabet, i am not getting the scope of store, how to get it?: i written this function in different file
    getLetter = function letters() {
    var items = [];

    for (var i = 65; i <= 90; i++) {
    //
    items.push({
    text: String.fromCharCode(i),
    enableToggle: true,
    toggleGroup: 'AZsearch',
    toggleHandler: buttonToggleHandler,
    scope: this,

    }, '', '-', '');

    }
    for (var i = 49; i <= 57; i++) {
    items.push({
    text: String.fromCharCode(i),
    enableToggle: true,
    //store:this.store,
    toggleGroup: 'AZsearch',
    toggleHandler: buttonToggleHandler,
    }, '-', '');
    }
    return items;
    }
    buttonToggleHandler = function (button, state) {
    if (state == true) {
    var abc = button.text;
    alert(getStore);
    ds.load({
    params: {
    task: 'alpha_search'
    }
    });
    }
    }

    I am using it like this: in main front end file
    Code:

    var alpha_letter=new getLetter();

    tbar:{alpha_letter}

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    1. It's:
    Code:
    var alpha_letter = getLetter();
    ...
    tbar: alpha_letter
    2. Why not simply include 'abc' in the params for the ds.load?

  5. #5
    Sencha User
    Join Date
    Aug 2010
    Posts
    29
    Vote Rating
    0
    nmohan.025 is on a distinguished road

      0  

    Default regarding parameters

    regarding parameters


    I tried that but ds is not loading because that factory function is in different file

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    So the problem is that you don't have access to the store?

    Is this the tbar for the grid itself? In that case you could use:
    Code:
    var grid = button.findParentByType('grid');
    var ds = grid.getStore();

  7. #7
    Sencha User
    Join Date
    Aug 2010
    Posts
    29
    Vote Rating
    0
    nmohan.025 is on a distinguished road

      0  

    Default regarding parameter passing

    regarding parameter passing


    i tried this but it is showing grid is null

  8. #8
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You are currently setting the scope of the button handler to 'this', but you could also set it to a parameter that is passed to the getLetters method.
    I assume you know the store when you call getLetters?

  9. #9
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. Passing parameters in ArrayStore and C#
    By ucoxk in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 9 Sep 2010, 9:30 PM
  2. Passing Parameters from One component to another
    By sajan in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 6 Jul 2010, 2:50 AM
  3. Passing parameters..
    By riets003 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 13 Sep 2009, 11:24 PM
  4. passing parameters to a new class
    By archmisha in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 19 Oct 2008, 5:01 PM
  5. Passing parameters from Ruby to JS.
    By akalache in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 18 Jul 2007, 5:03 AM

Thread Participants: 2