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
 
301Hainaut2012/08/31 08:29:52 PM
302Liege2012/08/31 08:29:52 PM
303Limburg2012/08/31 08:29:52 PM
304Luxembourg2012/08/31 08:29:52 PM
305Namur2012/08/31 08:29:52 PM
306Oost-Vlaanderen2012/08/31 08:29:52 PM
307West-Vlaanderen2012/08/31 08:29:52 PM
308Brabant Wallon2012/08/31 08:29:52 PM
309Brussels Hoofdstedelijk Gewest2012/08/31 08:29:52 PM
310Vlaams-Brabant2012/08/31 08:29:52 PM
311Bam2012/08/31 08:29:52 PM
312Boulkiemde2012/08/31 08:29:52 PM
313Ganzourgou2012/08/31 08:29:52 PM
314Gnagna2012/08/31 08:29:52 PM
315Kouritenga2012/08/31 08:29:52 PM
316Oudalan2012/08/31 08:29:52 PM
317Passore2012/08/31 08:29:52 PM
318Sanguie2012/08/31 08:29:52 PM
319Soum2012/08/31 08:29:52 PM
320Tapoa2012/08/31 08:29:52 PM
321Zoundweogo2012/08/31 08:29:52 PM
322Bale2012/08/31 08:29:52 PM
323Banwa2012/08/31 08:29:52 PM
324Bazega2012/08/31 08:29:52 PM
325Bougouriba2012/08/31 08:29:52 PM
326Boulgou2012/08/31 08:29:52 PM
327Gourma2012/08/31 08:29:52 PM
328Houet2012/08/31 08:29:52 PM
329Ioba2012/08/31 08:29:52 PM
330Kadiogo2012/08/31 08:29:52 PM
331Kenedougou2012/08/31 08:29:52 PM
332Komoe2012/08/31 08:29:52 PM
333Komondjari2012/08/31 08:29:52 PM
334Kompienga2012/08/31 08:29:52 PM
335Kossi2012/08/31 08:29:52 PM
336Koulpelogo2012/08/31 08:29:52 PM
337Kourweogo2012/08/31 08:29:52 PM
338Leraba2012/08/31 08:29:52 PM
339Loroum2012/08/31 08:29:52 PM
340Mouhoun2012/08/31 08:29:52 PM
341Namentenga2012/08/31 08:29:52 PM
342Naouri2012/08/31 08:29:52 PM
343Nayala2012/08/31 08:29:52 PM
344Noumbiel2012/08/31 08:29:52 PM
345Oubritenga2012/08/31 08:29:52 PM
346Poni2012/08/31 08:29:52 PM
347Sanmatenga2012/08/31 08:29:52 PM
348Seno2012/08/31 08:29:52 PM
349Sissili2012/08/31 08:29:52 PM
350Sourou2012/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;}'
                    )
                )
            ),
        ),
    )
);