PDA

View Full Version : FormPanel buttons on the Top



tej
11 Feb 2011, 12:38 PM
Hi,

I have a form panel. When I put the buttons in the buttons[] array. They appear at the bottom of the panel. However, I would like to have them at the top besides the title.

Any idea how this can be achieved ?

~Tej

johnathanhebert
11 Feb 2011, 1:08 PM
The buttons config automatically uses the items in the "fbar" config... see the Panel initComponent:

...
if(this.buttons){
this.fbar = this.buttons;
this.buttons = null;
}
if(this.fbar){
this.createFbar(this.fbar);
}...

If you want them in a top toolbar... just use the tbar config instead of the buttons config property

tej
11 Feb 2011, 1:49 PM
But in that case, the buttons loose the formBind property and are enabled even if validations fail ! :(

Condor
12 Feb 2011, 12:50 AM
Unfortunately, formBind only works for 'buttons'.

For buttons in other places, you will manually have to enable/disable them from the 'clientvalidation' event.