ZendX_JQuery Form Elements and DecoratorsAll View Helpers are pressed into Zend_Form elements or decorators also. They can even be
easily integrated into your already existing forms. To enable a Form for Zend_JQuery support
you can use two ways: Init your form as General Elements and Decorator UsageBoth elements and decorators of the Zend jQuery Form set can be initialized with
the option key Additionally elements jQuery options can be customized by the following methods:
Each jQuery related Decorator also owns a getJQueryParams() method, to set options you have to use the setDecorators(), addDecorator() or addDecorators() functionality of a form element and set the jQueryParams key as option: Form ElementsThe Zend Framework jQuery Extras Extension comes with the following Form Elements:
Form DecoratorsThe following Decorators come with the Zend Framework jQuery Extension:
Utilizing the Container elements is a bit more complicated, the following example builds a Form with 2 SubForms in a TabContainer: Example #1 SubForms with TabContainer Decorator The following example makes use of all Form elements and wraps them into 2 subforms that are decorated with a tab container. First
we build the basic Setting the Form Id (in this case to 'mainForm') is an important step for the TabContainer. It is needed that the subforms can relate
to the Container Id in a later form building stage. We now initialize two SubForms that will be decorated with the
In this stage it is important that the
Three additional lines are missing to put it all together and we have a jQuery animated form:
Example #2 Wrapping a Form into the Dialog Container The only use for the Dialog Container in Zend Form context is to wrap itself around a form and display it in a dialog. Its important to remember that the order of the decorators has to be different than in the Accordion and Tab Container examples.
|