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
 
451Chuquisaca2012/08/31 08:29:52 PM
452Cochabamba2012/08/31 08:29:52 PM
453El Beni2012/08/31 08:29:52 PM
454La Paz2012/08/31 08:29:52 PM
455Oruro2012/08/31 08:29:52 PM
456Pando2012/08/31 08:29:52 PM
457Potosi2012/08/31 08:29:52 PM
458Santa Cruz2012/08/31 08:29:52 PM
459Tarija2012/08/31 08:29:52 PM
460Acre2012/08/31 08:29:52 PM
461Alagoas2012/08/31 08:29:52 PM
462Amapa2012/08/31 08:29:52 PM
463Amazonas2012/08/31 08:29:52 PM
464Bahia2012/08/31 08:29:52 PM
465Ceara2012/08/31 08:29:52 PM
466Distrito Federal2012/08/31 08:29:52 PM
467Espirito Santo2012/08/31 08:29:52 PM
468Mato Grosso do Sul2012/08/31 08:29:52 PM
469Maranhao2012/08/31 08:29:52 PM
470Mato Grosso2012/08/31 08:29:52 PM
471Minas Gerais2012/08/31 08:29:52 PM
472Para2012/08/31 08:29:52 PM
473Paraiba2012/08/31 08:29:52 PM
474Parana2012/08/31 08:29:52 PM
475Piaui2012/08/31 08:29:52 PM
476Rio de Janeiro2012/08/31 08:29:52 PM
477Rio Grande do Norte2012/08/31 08:29:52 PM
478Rio Grande do Sul2012/08/31 08:29:52 PM
479Rondonia2012/08/31 08:29:52 PM
480Roraima2012/08/31 08:29:52 PM
481Santa Catarina2012/08/31 08:29:52 PM
482Sao Paulo2012/08/31 08:29:52 PM
483Sergipe2012/08/31 08:29:52 PM
484Goias2012/08/31 08:29:52 PM
485Pernambuco2012/08/31 08:29:52 PM
486Tocantins2012/08/31 08:29:52 PM
487Bimini2012/08/31 08:29:52 PM
488Cat Island2012/08/31 08:29:52 PM
489Exuma2012/08/31 08:29:52 PM
490Inagua2012/08/31 08:29:52 PM
491Long Island2012/08/31 08:29:52 PM
492Mayaguana2012/08/31 08:29:52 PM
493Ragged Island2012/08/31 08:29:52 PM
494Harbour Island2012/08/31 08:29:52 PM
495New Providence2012/08/31 08:29:52 PM
496Acklins and Crooked Islands2012/08/31 08:29:52 PM
497Freeport2012/08/31 08:29:52 PM
498Fresh Creek2012/08/31 08:29:52 PM
499Governor's Harbour2012/08/31 08:29:52 PM
500Green Turtle Cay2012/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;}'
                    )
                )
            ),
        ),
    )
);