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
 
351Tuy2012/08/31 08:29:52 PM
352Yagha2012/08/31 08:29:52 PM
353Yatenga2012/08/31 08:29:52 PM
354Ziro2012/08/31 08:29:52 PM
355Zondoma2012/08/31 08:29:52 PM
356Mikhaylovgrad2012/08/31 08:29:52 PM
357Blagoevgrad2012/08/31 08:29:52 PM
358Burgas2012/08/31 08:29:52 PM
359Dobrich2012/08/31 08:29:52 PM
360Gabrovo2012/08/31 08:29:52 PM
361Grad Sofiya2012/08/31 08:29:52 PM
362Khaskovo2012/08/31 08:29:52 PM
363Kurdzhali2012/08/31 08:29:52 PM
364Kyustendil2012/08/31 08:29:52 PM
365Lovech2012/08/31 08:29:52 PM
366Montana2012/08/31 08:29:52 PM
367Pazardzhik2012/08/31 08:29:52 PM
368Pernik2012/08/31 08:29:52 PM
369Pleven2012/08/31 08:29:52 PM
370Plovdiv2012/08/31 08:29:52 PM
371Razgrad2012/08/31 08:29:52 PM
372Ruse2012/08/31 08:29:52 PM
373Shumen2012/08/31 08:29:52 PM
374Silistra2012/08/31 08:29:52 PM
375Sliven2012/08/31 08:29:52 PM
376Smolyan2012/08/31 08:29:52 PM
377Sofiya2012/08/31 08:29:52 PM
378Stara Zagora2012/08/31 08:29:52 PM
379Turgovishte2012/08/31 08:29:52 PM
380Varna2012/08/31 08:29:52 PM
381Veliko Turnovo2012/08/31 08:29:52 PM
382Vidin2012/08/31 08:29:52 PM
383Vratsa2012/08/31 08:29:52 PM
384Yambol2012/08/31 08:29:52 PM
385Al Hadd2012/08/31 08:29:52 PM
386Al Manamah2012/08/31 08:29:52 PM
387Jidd Hafs2012/08/31 08:29:52 PM
388Sitrah2012/08/31 08:29:52 PM
389Al Mintaqah al Gharbiyah2012/08/31 08:29:52 PM
390Mintaqat Juzur Hawar2012/08/31 08:29:52 PM
391Al Mintaqah ash Shamaliyah2012/08/31 08:29:52 PM
392Al Mintaqah al Wusta2012/08/31 08:29:52 PM
393Madinat2012/08/31 08:29:52 PM
394Ar Rifa2012/08/31 08:29:52 PM
395Madinat Hamad2012/08/31 08:29:52 PM
396Al Muharraq2012/08/31 08:29:52 PM
397Al Asimah2012/08/31 08:29:52 PM
398Al Janubiyah2012/08/31 08:29:52 PM
399Ash Shamaliyah2012/08/31 08:29:52 PM
400Al Wusta2012/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;}'
                    )
                )
            ),
        ),
    )
);