Guest User

Untitled

a guest
Jan 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <div class="span-11">
  2. <?php
  3. $this->widget('zii.widgets.grid.CGridView', array(
  4. 'id' => 'item-grid',
  5. 'dataProvider' => $modelA->search(),
  6. 'filter' => $modelA,
  7. 'columns' => array(
  8. array(
  9. 'name' => 'name',
  10. 'type' => 'raw',
  11. 'value' => '$data->name',
  12. 'filter' => CHtml::activeTextField($modelA, 'name'),
  13. ),
  14. ...
  15. array
  16. (
  17. 'class' => 'CButtonColumn',
  18. 'template' => '{add}',
  19. 'buttons' => array
  20. (
  21. 'add' => array
  22. (
  23. 'label' => 'Add',
  24. 'url' => 'Yii::app()->controller->createUrl("insertItem", array("id"=>$data->primaryKey))',
  25. ),
  26. ),
  27. ),
  28. ),
  29. ));
  30. ?>
  31. </div>
  32.  
  33.  
  34. <div class="span-12">
  35. <?php
  36. $this->widget('zii.widgets.grid.CGridView', array(
  37. 'id' => 'trn-grid',
  38. 'dataProvider' => $modelB->search(),
  39. 'columns' => array(
  40. array(
  41. 'name' => 'No.',
  42. 'value' => '$row + 1', //count rows
  43. 'htmlOptions' => array('style' => 'text-align: right',),
  44. ),
  45. ...
  46. array
  47. (
  48. 'class' => 'CButtonColumn',
  49. 'template' => '{delete}',
  50. 'buttons' => array
  51. (
  52. 'delete' => array
  53. (
  54. 'label' => 'Delete',
  55. 'imageUrl' => Yii::app()->request->baseUrl . '/images/delete.png',
  56. 'url' => 'Yii::app()->controller->createUrl("delete", array("id"=>$data->primaryKey))',
  57. ),
  58. ),
  59. ),
  60. ),
  61. ));
  62. ?>
  63. </div>
Add Comment
Please, Sign In to add comment