Results 1 to 9 of 9

Thread: Default toolbar in tabpanels

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    78
    Vote Rating
    2
      0  

    Default Default toolbar in tabpanels

    I have a bunch of custom panels defined, and a tab panel that is filled with instances of my panels when the user clicks a menu.

    I'd like each panel that opens to have a toolbar with some buttons on it with the same handlers each time, as well as it's own buttons and contents. How do I achieve this with Sencha Designer 2?

    I'm enjoying the ease of Sencha Designer 2 beta so far!
    thanks

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    So you'd like the TabPanel to have a set of buttons that are always there but then within each specific tab add/remove additional buttons while keeping the set of buttons that tabpanel always has?
    Aaron Conran
    @aconran

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    78
    Vote Rating
    2
      0  

    Default

    yes, although I think it's more accurate to say I want the panels within the tabpanel to have a common set of buttons. If I wasn't using Designer I would probably add the buttons in the function when adding the panel to the tabpanel, but I'd like to be able to edit them visually and keep things wsyiwyg. I want to define all the panels with a common parent which I could then edit, and be able to edit the panels with the common buttons on them.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    78
    Vote Rating
    2
      0  

    Default

    I just tried creating a class, dragging it to the viewport and creating a link to it, which I thought might do the trick, but it created a duplicate which wasn't editable. This is probably a bug - but I'd rather it created another class extended from the first one than was prevented!

    version 2.0-beta build 288

  5. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Quote Originally Posted by pdm View Post
    I just tried creating a class, dragging it to the viewport and creating a link to it, which I thought might do the trick, but it created a duplicate which wasn't editable. This is probably a bug - but I'd rather it created another class extended from the first one than was prevented!

    version 2.0-beta build 288
    If you can reproduce this, create a separate thread in the bug forum and provide us the steps to reproduce so we can get it fixed.
    Aaron Conran
    @aconran

  6. #6
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Quote Originally Posted by pdm View Post
    yes, although I think it's more accurate to say I want the panels within the tabpanel to have a common set of buttons. If I wasn't using Designer I would probably add the buttons in the function when adding the panel to the tabpanel, but I'd like to be able to edit them visually and keep things wsyiwyg. I want to define all the panels with a common parent which I could then edit, and be able to edit the panels with the common buttons on them.
    The easiest way would probably be to add all of the buttons you want to the common toolbar in the tabpanel. Then based off of activate and deactivate events for the panels within the tabpanel I would show/hide the buttons you want or don't want.
    Aaron Conran
    @aconran

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    78
    Vote Rating
    2
      0  

    Default

    That's pretty good if my panels didn't have many things on them.

    The problem is there's going to be maybe 5 buttons on every panel that need to do the same thing every time, and hundreds of panels with their own buttons.

    Ideally I'd like to be able to design the 'parent' panel then later people will be able to independently make the individual child panels with their own form stuff and related, custom buttons in.

  8. #8
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Vote Rating
    147
      0  

    Default

    Sure then add the common ones to the toolbar and dynamically add/remove them via source code.
    Aaron Conran
    @aconran

  9. #9
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    78
    Vote Rating
    2
      0  

    Default

    which toolbar? and what do you mean by 'via source code'? I'm not keen to make changes after building my project, as then I won't be able to go back to Designer later on and make edits to my project.

    As a workaround, I can design both toolbars and have a function that removes one of them and adds it's contents to the other when the panel is added to the tabpanel. Unfortunately, this would only work at runtime, and not give my team a nice preview of the completed toolbar.

Posting Permissions

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