1. #1
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default Adding a Menu to a ContentPanel when Icon is clicked

    Adding a Menu to a ContentPanel when Icon is clicked


    Hi there,

    I have a TabPanel in whose TabItems the user can add/remove ContentPanel(s). I would like to add a Menu to the ContentPanel. The Menu should be displayed when the user clicks on the ContentPanel icon.

    Any ideas?

    Thank You!

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

  3. #3
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default


    Thanks, but that would mean actually creating a toolbar in the TopComponent, add a button to it and then use the setMenu() method. What I'd like to do is display a menu when the user clicks the icon in the header on the top left on the ContentPanel.

    This way I would not waste screen estate with another toolbar.

    Thanks again.

  4. #4
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    try this...

    create a toolbutton, add to panel header and then when click event fires, create a menu and call menu.show(toolbutton)

  5. #5
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default


    Works perfectly! Very last question...

    Is there a way to display the ToolButton(s) on the left before the header text instead of right?

    I can't thank you enough for all your help

  6. #6
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    not that I know... consider extending ContentPanel and replacing header with your own extended header that implements the buttons differently - you have the source and would be really easy to do

  7. #7
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default


    Cool!

Thread Participants: 1