Results 1 to 2 of 2

Thread: Multiple hidden toolbar buttons vs single dynamically changing button (best practice)

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Vote Rating

    Default Multiple hidden toolbar buttons vs single dynamically changing button (best practice)

    So I'm developing an app based around a navigation view. At various times in the app I'm showing and hiding buttons in the navigationBar. As of now I've created a separate button for each action needed and set it hidden by default, showing/hiding as necessary.

    This morning I though of an alternative: Say I had 10 buttons that display in the toolbar at different times throughout my app. I could reduce the numbers of buttons I actually instantiate by reusing buttons that have the same purpose, (a done button for a form for example).

    So say I have a 3 done buttons for 3 separate forms. I could essentially use the same button for each form by setting the action of that button to be relevant to the form.

    Anyone have any thoughts on what might be better for performance? more buttons super specific, less buttons with dynamically set actions....

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    If you can consolidate number of components you use is very much suggested for performance as long as you don't have to do too much to reuse.

    I often use the action custom property on buttons and in the controller have listeners for button with certain actions. This would be very easy to change the action property and set the text.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

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