View Full Version : Using ExtJS components in Zend_Form script

21 May 2010, 7:51 AM
Hello all,

I am wondering if it's possible to use the ExtJS DatePicker / Calendar component in a Zend_Form script like the script below, i want to use the datepicker in a Bug Report Form for selecting the date in the date_reported field when the bug is reported. The Zend_Form script that i have looks like this


class Form_BugReportForm extends CMS_Form
public function __construct($options = null)

// add element: date textbox
$date = new Zend_Form_Element_Text('date_reported');
$date->setLabel('Date the issue occurred (dd-mm-yyyy):')
->addValidator(new Zend_Validate_Date('DD-MM-YYYY'))
->setAttrib('size', 20);

// add element: URL textbox
$url = new Zend_Form_Element_Text('url');
$url->setLabel('Issue URL:')
->setAttrib('size', 50);

// add element: description text area
$editorOptions = new Zend_Config_Ini(APPLICATION_PATH . '/configs/tinymce.ini');
// add element: description text area
$description = new CMS_Form_Element_TinyMce('description', array(
'label' => 'Issue description:',
'required' => true,
'cols' => '80',
'rows' => '10',
'editorOptions' => $editorOptions->form->elements->body->options->editorOptions

// add element: priority select box
$priority = new Zend_Form_Element_Select('priority');
$priority->setLabel('Issue priority:')
'low' =>'Low',
'med' =>'Medium',
'high' =>'High'

// add element: status select box
$status = new Zend_Form_Element_Select('status');
$status->setLabel('Current status:')
'new' =>'New',
'in_progress' =>'In Progress',
'resolved' =>'Resolved'

// add element: submit button
$submit = new Zend_Form_Element_Submit('submit');

$this->addElements(array($date, $url, $description, $priority, $status, $submit));