JSON Grid View

Basic example of usage

The following grid, displays 50 rows on each page from a table of around 4000 records (not indexed).

Note This widget requires special server config:
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
	header( 'Content-type: application/json' );
	$this->renderPartial('_grid', compact('model'));
	Yii::app()->end();
}
ID Name Create Time Edit
 
401Bujumbura2012/08/31 08:29:52 PM
402Bubanza2012/08/31 08:29:52 PM
403Bururi2012/08/31 08:29:52 PM
404Cankuzo2012/08/31 08:29:52 PM
405Cibitoke2012/08/31 08:29:52 PM
406Gitega2012/08/31 08:29:52 PM
407Karuzi2012/08/31 08:29:52 PM
408Kayanza2012/08/31 08:29:52 PM
409Kirundo2012/08/31 08:29:52 PM
410Makamba2012/08/31 08:29:52 PM
411Muyinga2012/08/31 08:29:52 PM
412Ngozi2012/08/31 08:29:52 PM
413Rutana2012/08/31 08:29:52 PM
414Ruyigi2012/08/31 08:29:52 PM
415Muramvya2012/08/31 08:29:52 PM
416Mwaro2012/08/31 08:29:52 PM
417Alibori2012/08/31 08:29:52 PM
418Atakora2012/08/31 08:29:52 PM
419Atlanyique2012/08/31 08:29:52 PM
420Borgou2012/08/31 08:29:52 PM
421Collines2012/08/31 08:29:52 PM
422Kouffo2012/08/31 08:29:52 PM
423Donga2012/08/31 08:29:52 PM
424Littoral2012/08/31 08:29:52 PM
425Mono2012/08/31 08:29:52 PM
426Oueme2012/08/31 08:29:52 PM
427Plateau2012/08/31 08:29:52 PM
428Zou2012/08/31 08:29:52 PM
429Devonshire2012/08/31 08:29:52 PM
430Hamilton2012/08/31 08:29:52 PM
431Paget2012/08/31 08:29:52 PM
432Pembroke2012/08/31 08:29:52 PM
433Saint George2012/08/31 08:29:52 PM
434Saint George's2012/08/31 08:29:52 PM
435Sandys2012/08/31 08:29:52 PM
436Smiths2012/08/31 08:29:52 PM
437Southampton2012/08/31 08:29:52 PM
438Warwick2012/08/31 08:29:52 PM
439Alibori2012/08/31 08:29:52 PM
440Belait2012/08/31 08:29:52 PM
441Brunei and Muara2012/08/31 08:29:52 PM
442Temburong2012/08/31 08:29:52 PM
443Collines2012/08/31 08:29:52 PM
444Kouffo2012/08/31 08:29:52 PM
445Donga2012/08/31 08:29:52 PM
446Littoral2012/08/31 08:29:52 PM
447Tutong2012/08/31 08:29:52 PM
448Oueme2012/08/31 08:29:52 PM
449Plateau2012/08/31 08:29:52 PM
450Zou2012/08/31 08:29:52 PM
$this->widget(
    'booster.widgets.TbJsonGridView',
    array(
        'dataProvider' => $model->search(),
        'filter' => $model,
        'type' => 'striped bordered condensed',
        'summaryText' => false,
        'cacheTTL' => 10, // cache will be stored 10 seconds (see cacheTTLType)
        'cacheTTLType' => 's', // type can be of seconds, minutes or hours
        'columns' => array(
            'id',
            'name',
            array(
                'name' => 'create_time',
                'type' => 'datetime'
            ),
            array(
                'header' => Yii::t('ses', 'Edit'),
                'class' => 'booster.widgets.TbJsonButtonColumn',
                'template' => '{view} {delete}',
                'viewButtonUrl' => null,
                'updateButtonUrl' => null,
                'deleteButtonUrl' => null,
                'buttons' => array(
                    'delete' => array(
                        'click' => 'function(){return false;}'
                    )
                )
            ),
        ),
    )
);