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
 
151Syunik'2012/08/31 08:29:52 PM
152Tavush2012/08/31 08:29:52 PM
153Vayots' Dzor2012/08/31 08:29:52 PM
154Yerevan2012/08/31 08:29:52 PM
155Benguela2012/08/31 08:29:52 PM
156Bie2012/08/31 08:29:52 PM
157Cabinda2012/08/31 08:29:52 PM
158Cuando Cubango2012/08/31 08:29:52 PM
159Cuanza Norte2012/08/31 08:29:52 PM
160Cuanza Sul2012/08/31 08:29:52 PM
161Cunene2012/08/31 08:29:52 PM
162Huambo2012/08/31 08:29:52 PM
163Huila2012/08/31 08:29:52 PM
164Malanje2012/08/31 08:29:52 PM
165Namibe2012/08/31 08:29:52 PM
166Moxico2012/08/31 08:29:52 PM
167Uige2012/08/31 08:29:52 PM
168Zaire2012/08/31 08:29:52 PM
169Lunda Norte2012/08/31 08:29:52 PM
170Lunda Sul2012/08/31 08:29:52 PM
171Bengo2012/08/31 08:29:52 PM
172Luanda2012/08/31 08:29:52 PM
173Buenos Aires2012/08/31 08:29:52 PM
174Catamarca2012/08/31 08:29:52 PM
175Chaco2012/08/31 08:29:52 PM
176Chubut2012/08/31 08:29:52 PM
177Cordoba2012/08/31 08:29:52 PM
178Corrientes2012/08/31 08:29:52 PM
179Distrito Federal2012/08/31 08:29:52 PM
180Entre Rios2012/08/31 08:29:52 PM
181Formosa2012/08/31 08:29:52 PM
182Jujuy2012/08/31 08:29:52 PM
183La Pampa2012/08/31 08:29:52 PM
184La Rioja2012/08/31 08:29:52 PM
185Mendoza2012/08/31 08:29:52 PM
186Misiones2012/08/31 08:29:52 PM
187Neuquen2012/08/31 08:29:52 PM
188Rio Negro2012/08/31 08:29:52 PM
189Salta2012/08/31 08:29:52 PM
190San Juan2012/08/31 08:29:52 PM
191San Luis2012/08/31 08:29:52 PM
192Santa Cruz2012/08/31 08:29:52 PM
193Santa Fe2012/08/31 08:29:52 PM
194Santiago del Estero2012/08/31 08:29:52 PM
195Tierra del Fuego2012/08/31 08:29:52 PM
196Tucuman2012/08/31 08:29:52 PM
197Burgenland2012/08/31 08:29:52 PM
198Karnten2012/08/31 08:29:52 PM
199Niederosterreich2012/08/31 08:29:52 PM
200Oberosterreich2012/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;}'
                    )
                )
            ),
        ),
    )
);