0

I wonder whether I should choose an Ext.Panel with an hbox layout or an Ext.Toolbar in order to put some buttons below a comment input field. Both are suitable for holding a set of controls.

ideaboxer
  • 3,863
  • 8
  • 43
  • 62

1 Answers1

1

It depends on the required functionality- using a hbox leads to further nesting within your view, so a more complex dom (which typically should be avoided), whereas a toolbar can be applied directly to the parent component. Though both may be suitable for holding a set of controls, toolbars are specifically designed to do so, as such they are a more complex object- again, if you require the functionality they provide (styling, methods etc) then using one should be the choice. Its kind of hard to say based on the limited detail provided

SW4
  • 69,876
  • 20
  • 132
  • 137
  • What would you choose for an input box with two buttons "OK" and "Cancel"? I use it in a very similar manner. – ideaboxer Nov 12 '13 at 14:34
  • 1
    Well such an input box would simply be a MessageBox component (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.window.MessageBox) so I wouldnt apply a toolbar. However if I wanted to replicate the look and feel, I would use a toolbar on a Window component.. – SW4 Nov 12 '13 at 14:35
  • Since it is not a separate window but an embedded command input on a page with many other controls, I guess a form with a toolbar below it is the preferable choice. – ideaboxer Nov 13 '13 at 09:01