Created
September 10, 2011 14:26
-
-
Save anonymous/1208360 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="span-11"> | |
<?php | |
$this->widget('zii.widgets.grid.CGridView', array( | |
'id' => 'item-grid', | |
'dataProvider' => $modelA->search(), | |
'filter' => $modelA, | |
'columns' => array( | |
array( | |
'name' => 'name', | |
'type' => 'raw', | |
'value' => '$data->name', | |
'filter' => CHtml::activeTextField($modelA, 'name'), | |
), | |
... | |
array | |
( | |
'class' => 'CButtonColumn', | |
'template' => '{add}', | |
'buttons' => array | |
( | |
'add' => array | |
( | |
'label' => 'Add', | |
'url' => 'Yii::app()->controller->createUrl("insertItem", array("id"=>$data->primaryKey))', | |
), | |
), | |
), | |
), | |
)); | |
?> | |
</div> | |
<div class="span-12"> | |
<?php | |
$this->widget('zii.widgets.grid.CGridView', array( | |
'id' => 'trn-grid', | |
'dataProvider' => $modelB->search(), | |
'columns' => array( | |
array( | |
'name' => 'No.', | |
'value' => '$row + 1', //count rows | |
'htmlOptions' => array('style' => 'text-align: right',), | |
), | |
... | |
array | |
( | |
'class' => 'CButtonColumn', | |
'template' => '{delete}', | |
'buttons' => array | |
( | |
'delete' => array | |
( | |
'label' => 'Delete', | |
'imageUrl' => Yii::app()->request->baseUrl . '/images/delete.png', | |
'url' => 'Yii::app()->controller->createUrl("delete", array("id"=>$data->primaryKey))', | |
), | |
), | |
), | |
), | |
)); | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment