[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 = []) { $form = new Qs_Form($this->_getFormOptions()); $form->addElement('hidden', 'action', ['value' => 'insert']); $this->_bindFormFields($form); return $form; } protected function _bindFormFields(Qs_Form $form) { $multiOptions = [ ['id' => 1, 'title' => 'N1'], ['id' => 2, 'title' => 'N2', 'sub' => [ ['id' => 21, 'title' => 'N2.1'], ['id' => 22, 'title' => 'N2.2', 'sub' => [ ['id' => 221, 'title' => 'N2.2.1'], ['id' => 222, 'title' => 'N2.2.2'], ['id' => 223, 'title' => 'N2.2.3'], ['id' => 224, 'title' => 'N2.2.4'], ]], ['id' => 23, 'title' => 'N2.3'], ]], ['id' => 3, 'title' => 'N3'], ]; $form->addElement('static', 'dump', ['label' => 'SUBMITTED VALUES']); $form->addElement( 'checkboxTree', 'element', [ 'label' => 'CheckboxTree', 'multiOptions' => $multiOptions, ] ); } }