protected function renderDynamicAdvancedSearchRows($panel, $maxCellsPerRow, $form) { assert('$form != null'); $content = $form->errorSummary($this->model); $content .= $this->renderDynamicClausesValidationHelperContent($form); $rowCount = 0; $suffix = $this->getSearchFormId(); $viewClassName = get_class($this); $modelClassName = get_class($this->model->getModel()); $formModelClassName = get_class($this->model); if ($this->model->dynamicClauses != null) { foreach ($this->model->dynamicClauses as $dynamicClause) { $attributeIndexOrDerivedType = ArrayUtil::getArrayValue($dynamicClause, 'attributeIndexOrDerivedType'); if ($attributeIndexOrDerivedType != null) { $searchAttributes = self::resolveSearchAttributeValuesForDynamicRow($dynamicClause, $attributeIndexOrDerivedType); $inputContent = DynamicSearchUtil::renderDynamicSearchAttributeInput($viewClassName, $modelClassName, $formModelClassName, (int) $rowCount, $attributeIndexOrDerivedType, $searchAttributes, $suffix); $content .= DynamicSearchUtil::renderDynamicSearchRowContent($viewClassName, $modelClassName, $formModelClassName, $rowCount, $attributeIndexOrDerivedType, $inputContent, $suffix); $rowCount++; } } } $content .= $this->renderAddExtraRowContent($rowCount); $content .= $this->renderAfterAddExtraRowContent($form); $content .= $this->renderDynamicSearchStructureContent($form); return $content; }
public function actionDynamicSearchAttributeInput($viewClassName, $modelClassName, $formModelClassName, $rowNumber, $attributeIndexOrDerivedType, $suffix = null) { if ($attributeIndexOrDerivedType == null) { Yii::app()->end(0, false); } $content = DynamicSearchUtil::renderDynamicSearchAttributeInput($viewClassName, $modelClassName, $formModelClassName, (int) $rowNumber, $attributeIndexOrDerivedType, array(), $suffix); Yii::app()->getClientScript()->setToAjaxMode(); Yii::app()->getClientScript()->render($content); echo $content; }