echo $form->labelEx($model, 'verb_monosyllabic');
?>
		<?php 
echo $form->textField($model, 'verb_monosyllabic');
?>
		<?php 
echo $form->error($model, 'verb_monosyllabic');
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'kategorie_id');
?>
		<?php 
echo $form->dropDownList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => 'alle Themen'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'grundwortschatz');
?>
		<?php 
echo $form->textField($model, 'grundwortschatz');
?>
		<?php 
echo $form->error($model, 'grundwortschatz');
?>
	</div>
?>
    </div>
    <div class="simple">
    <?php 
echo $form->hiddenField($model, 'author', array('size' => '30', 'readonly' => 'readonly', 'value' => Yii::app()->user->name));
?>
    </div>
    <div class="simple">
    <?php 
echo $form->labelEx($model, 'kategorie_id');
?>
    <?php 
echo $form->dropDownList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'), array('options' => array('1' => array('selected' => true))));
?>
    <!-- <?php 
echo $form->checkBoxList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'));
?>
 -->
    </div>
</div>
</div> <!-- formright -->

<!--
<div style="clear:both">
    <div style="padding:60px 0 0 0;">
        <?php 
echo $form->labelEx($model, 'quelle');
?>
        <?php 
echo $form->textField($model, 'quelle', array('size' => '30'));
?>
?>
		<?php 
echo $form->dropDownList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => 'alle Themen'));
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'anmerkung');
?>
		<?php 
echo $form->textArea($model, 'anmerkung', array('rows' => 3, 'cols' => 50));
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton('Suchen');
echo CHtml::resetButton('Reset');
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'detail-grid', 'dataProvider' => $model->search(), 'template' => '{summary} {pager} {items}', 'cssFile' => Yii::app()->baseUrl . '/css/customGridView.css', 'summaryText' => 'Ergebnis {start}-{end} von insgesamt {count}.', 'selectableRows' => '0', 'pager' => array('header' => false, 'cssFile' => Yii::app()->baseUrl . '/css/customPager.css', 'firstPageLabel' => 'Anfang', 'prevPageLabel' => '< zurück', 'nextPageLabel' => 'weiter >', 'lastPageLabel' => 'Ende'), 'selectionChanged' => 'select', 'columns' => array(array('name' => 'kiswahili', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'sw_grammatik_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_grammatik_id', CHtml::listData(sw_grammatik::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_fachgebiet_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_fachgebiet_id', CHtml::listData(sw_fachgebiet::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_gebrauch_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_gebrauch_id', CHtml::listData(sw_gebrauch::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_region_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_region_id', CHtml::listData(sw_region::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'deutsch', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'wortart_id', 'value' => '$data->wortart_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'wortart_id', CHtml::listData(wortarten::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:120px')), array('name' => 'herkunft_id', 'value' => '$data->herkunft_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'herkunft_id', CHtml::listData(herkunft::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:70px')), array('name' => 'noun_class', 'filter' => CHtml::activeDropDownList($model, 'noun_class', CHtml::listData(klassen::model()->findAll(array('order' => 'id')), 'klasse_standard', 'klasse_standard'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'kategorie_id', 'value' => '$data->kategorie_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:120px')), array('name' => 'anmerkung', 'htmlOptions' => array('style' => 'width:220px')))));
////        'panel 3'=>$this->renderPartial('list',null,true),
//    ),
//    // additional javascript options for the accordion plugin
//    'options'=>array(
//        'animated'=>'bounceslide',
//    ),
//));
?>

<h3>Suche einschränken: </h3>
<div class="adv_row">
<?php 
echo CHtml::activeDropDownList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Wortarten'));
?>
</div>
<div class="adv_row">
<?php 
echo CHtml::activeDropDownList($search, 'kategorie', CHtml::listData(kategorien::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Kategorien'));
?>
</div>
<!--
activeCheckBox: <?php 
echo CHtml::activeCheckBox($search, 'wortart', array('value' => 'Substantiv'));
?>
<br /><br />

<?php 
echo CHtml::activeCheckBoxList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('template' => '{input}{label}', 'separator' => '<br />', 'checkAll' => 'alle Wortarten'));
?>
-->
Example #5
0
<?php

$this->pageTitle = Yii::app()->name . ' - Begriffe verwalten';
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('wortschatz-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Begriffe verwalten</h1>

<div style="width:100%"> <!-- if the column width should be exact put px here -->
    <?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'wortschatz-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => '{summary} {pager} {items}', 'cssFile' => Yii::app()->baseUrl . '/css/customGridView.css', 'summaryText' => 'Ergebnis {start}-{end} von insgesamt {count}.', 'selectableRows' => '2', 'selectionChanged' => 'select', 'pager' => array('header' => false, 'cssFile' => Yii::app()->baseUrl . '/css/customPager.css', 'firstPageLabel' => 'Anfang', 'prevPageLabel' => '< zurück', 'nextPageLabel' => 'weiter >', 'lastPageLabel' => 'Ende'), 'columns' => array(array('class' => 'CCheckBoxColumn'), array('header' => 'Aktion', 'class' => 'CButtonColumn', 'template' => '{view} {update} {delete}', 'htmlOptions' => array('style' => 'width:60px; white-space:nowrap;')), array('name' => 'id', 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'kiswahili', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'sw_grammatik_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_grammatik_id', CHtml::listData(sw_grammatik::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_fachgebiet_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_fachgebiet_id', CHtml::listData(sw_fachgebiet::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_gebrauch_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_gebrauch_id', CHtml::listData(sw_gebrauch::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'sw_region_id', 'header' => '', 'filter' => CHtml::activeDropDownList($model, 'sw_region_id', CHtml::listData(sw_region::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'deutsch', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'deutsch_addition', 'header' => false, 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'wortart_id', 'value' => '$data->wortart_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'wortart_id', CHtml::listData(wortarten::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:120px')), array('name' => 'herkunft_id', 'value' => '$data->herkunft_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'herkunft_id', CHtml::listData(herkunft::model()->findAll(), 'id', 'kurz'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:70px')), array('name' => 'noun_class', 'filter' => CHtml::activeDropDownList($model, 'noun_class', CHtml::listData(klassen::model()->findAll(array('order' => 'id')), 'klasse_standard', 'klasse_standard'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'noun_animate', 'header' => 'A', 'type' => 'raw', 'value' => 'CHtml::activeCheckBox($data,"noun_animate",array("disabled"=>"disabled"))', 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'noun_singular_swahili', 'header' => 'Singular', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'noun_class_singular', 'header' => 'Kl.', 'htmlOptions' => array('style' => 'width:15px')), array('name' => 'noun_plural_swahili', 'header' => 'Plural (Sw)', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'noun_class_plural', 'header' => 'Kl.', 'htmlOptions' => array('style' => 'width:15px'), 'filter' => CHtml::activeDropDownList($model, 'noun_class_plural', CHtml::listData(wortschatz::model()->findAll(), 'noun_class_plural', 'noun_class_plural'), array('prompt' => ''))), array('name' => 'noun_plural_deutsch', 'header' => 'Plural (D)', 'htmlOptions' => array('style' => 'width:160px')), array('name' => 'verb_monosyllabic', 'header' => 'M', 'type' => 'raw', 'value' => 'CHtml::activeCheckBox($data,"verb_monosyllabic",array("disabled"=>"disabled"))', 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'verb_stem', 'htmlOptions' => array('style' => 'width:100px')), array('name' => 'verb_infinitive', 'htmlOptions' => array('style' => 'width:100px')), array('name' => 'kategorie_id', 'value' => '$data->kategorie_rel->bezeichnung', 'filter' => CHtml::activeDropDownList($model, 'kategorie_id', CHtml::listData(kategorien::model()->findAll(), 'id', 'bezeichnung'), array('prompt' => '')), 'htmlOptions' => array('style' => 'width:120px')), array('name' => 'grundwortschatz', 'header' => 'G', 'type' => 'raw', 'value' => 'CHtml::activeCheckBox($data,"grundwortschatz",array("disabled"=>"disabled"))', 'htmlOptions' => array('style' => 'width:10px')), array('name' => 'anmerkung', 'htmlOptions' => array('style' => 'width:220px')), array('name' => 'link', 'htmlOptions' => array('style' => 'width:80px')), array('name' => 'quelle', 'htmlOptions' => array('style' => 'width:100px')), array('name' => 'author', 'htmlOptions' => array('style' => 'width:30px')))));
?>
    
    <?php 
// small script to process the selected row. Add "alert(test[0]);" to the the function will display the (first) id
Yii::app()->clientScript->registerScript("selectedRows", "function select() { var test = new Array();  test=\$.fn.yiiGridView.getSelection('wortschatz-grid'); };", 4);
?>
</div>