Results 1 to 9 of 9

Thread: What's the correct way to get the buttons from an Ext.window.Window?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Oct 2009
    Vote Rating

    Default Answered: What's the correct way to get the buttons from an Ext.window.Window?

    Hi there,

    I have a Window, something like this:

    var buttons = getButtons(),
        w = Ext.create('Ext.window.Window',
             //config here...
            buttons : buttons
    Then in an event I want to iterate over this buttons, I get the window there but how to get the buttons?

    I have seen that I can get the docked elements and from there the array of buttons, this is a bit overkilling in my opinion, I mean, the code would be like:

    var buttons = [];
    Ext.Array.each(myWindow.getDockedElements(), function(de)
        if (is in the bottom)
              //check if it has buttons, if so then store them in the array
    In Ext 3.X there was a method in the window that returned the buttons, any idea how to get them now?


  2. 1 - Give an itemId to your window:
    PHP Code:
    2- Do whatever you need to do to generate the buttons

    3 - Use Ext.ComponentQuery.query to retrieve the buttons from the window:
    If the buttons are in a toolbar, you can use:
    PHP Code:
    Ext.ComponentQuery.query('myWindow toolbar button'); 
    The code above will return an array of all buttons that are inside a toolbar in your window.

Tags for this Thread

Posting Permissions

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