Exemple #1
0
 public function run()
 {
     $htmlOptions = array_merge(array('class' => 'form wide'), $this->htmlOptions);
     $form = new CForm($this->form, $this->form['model']);
     echo CHtml::openTag('div', $htmlOptions);
     echo $form->renderBegin();
     foreach ($form->getElements() as $element) {
         echo CHtml::openTag('div', array('class' => 'row'));
         echo $element->render();
         echo '</div>';
     }
     echo '<div style="display:block; height:30px; margin-top:10px;">';
     echo $form->renderButtons();
     echo '</div>';
     echo $form->getActiveFormWidget()->errorSummary($this->form['model']) . "\n";
     echo $form->renderEnd();
     echo '</div>';
 }
echo CHtml::tag('tbody', ['class' => 'tabular-input-container'], false, false);
foreach ($modelArray as $modelIndex => $model) {
    echo CHtml::tag('tr', ['class' => 'tabular-input'], false, false);
    $form = new CForm($elements['elements'][$modelIndex], $model);
    foreach ($form->getElements() as $element) {
        $element->name = "[{$modelIndex}]{$element->name}";
        echo CHtml::tag('td', [], $element->renderInput());
    }
    echo CHtml::closeTag('tr');
    //$form[$modelIndex] = $model;
}
echo CHtml::closeTag('tbody');
echo CHtml::closeTag('table');
echo CHtml::submitButton('Update');
echo CHtml::closeTag('div');
echo $formHead->renderEnd();
?>
<script>
	$(function() {
		$('select')
			.on('chosen:ready', function(chosen) {
				//console.log($(chosen.currentTarget).attr('oldtitle'));
				//console.log(chosen);
				$(chosen.currentTarget.nextSibling).attr('title', $(chosen.currentTarget).attr('title'));
				$('form [title!=""]').qtip({
					overwrite: true,
					content: {
						title: {
							text: 'Info'
//							button: 'Close'
						}