mrkoeh
(Mrkoeh)
January 16, 2013, 4:36am
1
i have a problem,
can anyone help me??
i want to add a dropdown list in _search file, but unsucces. .
this is my code :
<?php echo $data = CHtml::listData( TJurnal::model()->findAll(),'no_akun','keterangan' ); ?>
<div class="row">
<?php echo $form->label($model,'no_akun'); ?>>
<?php echo $form->dropDownList($model,'no_akun', $data);?>
</div>
sukunj
(Mendparasukunj27)
January 16, 2013, 5:02am
2
No need to do changes in _search() file …you can change in the admin file …the code is:
array(
'name'=>'state_id',
'value'=>'State::item($data->state_id)',
'filter'=> State::items(),
),
mrkoeh
(Mrkoeh)
January 16, 2013, 9:17am
3
sukunj:
No need to do changes in _search() file …you can change in the admin file …the code is:
array(
'name'=>'state_id',
'value'=>'State::item($data->state_id)',
'filter'=> State::items(),
),
thanks to sukunj,
but,
i want to add in the top of CGridView, like this :
3737
so, i think i must add the code on _search. .
can you help me please. . .
thanks before. .
The _search.php will get the dropdown under the "Advanced Search" section. The code you have posted in your first post should work there. Then, you could:
Remove the display:none property on the advanced search container (on admin.php)
Edit the _search.php to show only your Dropdown (remove everything else).
That should make it achieve your desired result.
B
sukunj
(Mendparasukunj27)
April 3, 2013, 10:21am
5
U CAN INCLUDE FOLLOWING CODE IN THE ADMIN.PHP FILE
$dataProvider = $model->search();
$pageSize = Yii::app()->user->getState("pageSize",@$_GET["pageSize"]);
$dataProvider->getPagination()->setPageSize($pageSize);
AND
‘dataProvider’=>$dataProvider,
AND
‘pager’=>array(
'class'=>'AjaxList',
//'maxButtonCount'=>25,
'maxButtonCount'=>$model->count(),
'header'=>''