Cara menggunakan TbExtendedGridView pada yii bootstrap / yii booster

Assalamualaikum Wr. Wb

Halo semua ini tadi ane habis searching di forum yii terus nemu topik tentang TbExtendedGridView
mungkin yang baca ini juga perlu tentang tutorial ini sok silahkan di sedot.
okay langsung aja cekitdot

pada Bootstrap.widgets.TbExtendedGridView yang ada pada bootstrap.
atau lebih jelas lihat di http://yii-booster.clevertech.biz/extended-grid.html
atau kalau males buka lihat kode ini aja deh 

code pada bootstrap:
  1. $this->widget('bootstrap.widgets.TbExtendedGridView', array(
  2. 'type' => 'striped bordered',
  3. 'dataProvider' => $gridDataProvider,
  4. 'template' => "{items}",
  5. 'bulkActions' => array(
  6. 'actionButtons' => array(
  7. array(
  8. 'buttonType' => 'button',
  9. 'type' => 'primary',
  10. 'size' => 'small',
  11. 'label' => 'Testing Primary Bulk Actions',
  12. 'click' => 'js:function(values){console.log(values);}'
  13. )
  14. ),
  15. // if grid doesn't have a checkbox column type, it will attach
  16. // one and this configuration will be part of it
  17. 'checkBoxColumnConfig' => array(
  18. 'name' => 'id'
  19. ),
  20. ),
  21. 'columns' => $gridColumns,
  22. ));

okay setelah anda melihat code di atas sekarang code di bawah ini adalah code hasil modifikasi yang telah terhubung dengan model pada NamaAplikasiAnda/protected/views/viewanda/admin.php
->widget('bootstrap.widgets.TbExtendedGridView', array(
        'type' => 'striped bordered',
        'dataProvider'=>$model->search(),
        'filter'=>$model,
        'template' => "{items}",
        'bulkActions' => array(
        'actionButtons' => array(
                array(
                        'buttonType' => 'button',
                        'type' => 'primary',
                        'size' => 'small',
                        'label' => 'Testing Primary Bulk Actions',
                        'click' => 'js:function(values){console.log(values);}'
                        )
                ),
                // if grid doesn't have a checkbox column type, it will attach
                // one and this configuration will be part of it
                'checkBoxColumnConfig' => array(
                    'name' => 'no'
                ),
        ),
        'columns' => array(
                'no',
                'nama',
                'path',
                'ukuran',
                'lvl',
                array(
                        'class'=>'CButtonColumn',
                ),
        ),
));
?>

Okay kalau begitu Semoga berhasil ya
:)
~Happy Coding~
Previous
Next Post »
0 Komentar