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
 
51Nebraska2012/08/31 08:29:52 PM
52New Hampshire2012/08/31 08:29:52 PM
53New Jersey2012/08/31 08:29:52 PM
54New Mexico2012/08/31 08:29:52 PM
55Nevada2012/08/31 08:29:52 PM
56New York2012/08/31 08:29:52 PM
57Ohio2012/08/31 08:29:52 PM
58Oklahoma2012/08/31 08:29:52 PM
59Oregon2012/08/31 08:29:52 PM
60Pennsylvania2012/08/31 08:29:52 PM
61Puerto Rico2012/08/31 08:29:52 PM
62Palau2012/08/31 08:29:52 PM
63Rhode Island2012/08/31 08:29:52 PM
64South Carolina2012/08/31 08:29:52 PM
65South Dakota2012/08/31 08:29:52 PM
66Tennessee2012/08/31 08:29:52 PM
67Texas2012/08/31 08:29:52 PM
68Utah2012/08/31 08:29:52 PM
69Virginia2012/08/31 08:29:52 PM
70Virgin Islands2012/08/31 08:29:52 PM
71Vermont2012/08/31 08:29:52 PM
72Washington2012/08/31 08:29:52 PM
73West Virginia2012/08/31 08:29:52 PM
74Wisconsin2012/08/31 08:29:52 PM
75Wyoming2012/08/31 08:29:52 PM
76Canillo2012/08/31 08:29:52 PM
77Encamp2012/08/31 08:29:52 PM
78La Massana2012/08/31 08:29:52 PM
79Ordino2012/08/31 08:29:52 PM
80Sant Julia de Loria2012/08/31 08:29:52 PM
81Andorra la Vella2012/08/31 08:29:52 PM
82Escaldes-Engordany2012/08/31 08:29:52 PM
83Abu Dhabi2012/08/31 08:29:52 PM
84Ajman2012/08/31 08:29:52 PM
85Dubai2012/08/31 08:29:52 PM
86Fujairah2012/08/31 08:29:52 PM
87Ras Al Khaimah2012/08/31 08:29:52 PM
88Sharjah2012/08/31 08:29:52 PM
89Umm Al Quwain2012/08/31 08:29:52 PM
90Badakhshan2012/08/31 08:29:52 PM
91Badghis2012/08/31 08:29:52 PM
92Baghlan2012/08/31 08:29:52 PM
93Bamian2012/08/31 08:29:52 PM
94Farah2012/08/31 08:29:52 PM
95Faryab2012/08/31 08:29:52 PM
96Ghazni2012/08/31 08:29:52 PM
97Ghowr2012/08/31 08:29:52 PM
98Helmand2012/08/31 08:29:52 PM
99Herat2012/08/31 08:29:52 PM
100Kabol2012/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;}'
                    )
                )
            ),
        ),
    )
);