array(2, 22, 224, 3) ); protected function _doInsert() { $form = $this->_getNewForm(); if ($form->validate()) { $data = $form->getValues(); $form->getElement('dump')->setValue(nl2br(var_export($data, true))); } $this->_addFormItem($form); return $this; } protected function _getNewForm(array $options = array()) { $form = new Qs_Form($this->_getFormOptions()); $form->addElement('hidden', 'action', array('value' => 'insert')); $this->_bindFormFields($form); return $form; } protected function _bindFormFields(Qs_Form $form) { $multiOptions = array( array('id' => 1, 'title' => 'N1'), array('id' => 2, 'title' => 'N2', 'sub' => array( array('id' => 21, 'title' => 'N2.1'), array('id' => 22, 'title' => 'N2.2', 'sub' => array( array('id' => 221, 'title' => 'N2.2.1'), array('id' => 222, 'title' => 'N2.2.2'), array('id' => 223, 'title' => 'N2.2.3'), array('id' => 224, 'title' => 'N2.2.4'), )), array('id' => 23, 'title' => 'N2.3'), )), array('id' => 3, 'title' => 'N3'), ); $form->addElement('static', 'dump', array('label' => 'SUBMITTED VALUES')); $form->addElement( 'checkboxTree', 'element', array( 'label' => 'CheckboxTree', 'multiOptions' => $multiOptions ) ); } }