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
 
201Salzburg2012/08/31 08:29:52 PM
202Steiermark2012/08/31 08:29:52 PM
203Tirol2012/08/31 08:29:52 PM
204Vorarlberg2012/08/31 08:29:52 PM
205Wien2012/08/31 08:29:52 PM
206Australian Capital Territory2012/08/31 08:29:52 PM
207New South Wales2012/08/31 08:29:52 PM
208Northern Territory2012/08/31 08:29:52 PM
209Queensland2012/08/31 08:29:52 PM
210South Australia2012/08/31 08:29:52 PM
211Tasmania2012/08/31 08:29:52 PM
212Victoria2012/08/31 08:29:52 PM
213Western Australia2012/08/31 08:29:52 PM
214Abseron2012/08/31 08:29:52 PM
215Agcabadi2012/08/31 08:29:52 PM
216Agdam2012/08/31 08:29:52 PM
217Agdas2012/08/31 08:29:52 PM
218Agstafa2012/08/31 08:29:52 PM
219Agsu2012/08/31 08:29:52 PM
220Ali Bayramli2012/08/31 08:29:52 PM
221Astara2012/08/31 08:29:52 PM
222Baki2012/08/31 08:29:52 PM
223Balakan2012/08/31 08:29:52 PM
224Barda2012/08/31 08:29:52 PM
225Beylaqan2012/08/31 08:29:52 PM
226Bilasuvar2012/08/31 08:29:52 PM
227Cabrayil2012/08/31 08:29:52 PM
228Calilabad2012/08/31 08:29:52 PM
229Daskasan2012/08/31 08:29:52 PM
230Davaci2012/08/31 08:29:52 PM
231Fuzuli2012/08/31 08:29:52 PM
232Gadabay2012/08/31 08:29:52 PM
233Ganca2012/08/31 08:29:52 PM
234Goranboy2012/08/31 08:29:52 PM
235Goycay2012/08/31 08:29:52 PM
236Haciqabul2012/08/31 08:29:52 PM
237Imisli2012/08/31 08:29:52 PM
238Ismayilli2012/08/31 08:29:52 PM
239Kalbacar2012/08/31 08:29:52 PM
240Kurdamir2012/08/31 08:29:52 PM
241Lacin2012/08/31 08:29:52 PM
242Lankaran2012/08/31 08:29:52 PM
243Lerik2012/08/31 08:29:52 PM
244Masalli2012/08/31 08:29:52 PM
245Mingacevir2012/08/31 08:29:52 PM
246Naftalan2012/08/31 08:29:52 PM
247Naxcivan2012/08/31 08:29:52 PM
248Neftcala2012/08/31 08:29:52 PM
249Oguz2012/08/31 08:29:52 PM
250Qabala2012/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;}'
                    )
                )
            ),
        ),
    )
);