Yii - CListView - External Sorting Links and Pagination

178 Views Asked by At

I'm using 'CListView' in my View page. I need to sort the CListView by external links like 'A-Z' or 'Z-A'. These links are present above the list.

Here is the code in my View page -

    $model = new Whisky();
    $dataProvider = $model->dashboard_whisky_list();
    $this->widget('zii.widgets.CListView', array(
        'id'=>'whisky-grid',
        'dataProvider'=>$dataProvider,
        'itemView'=>'_whisky_list',
        'template'=>'{pager}{items}{pager}',
        'ajaxUpdate'=>true,
        'beforeAjaxUpdate' => 'js:function(id) {showLoader();}',
        'afterAjaxUpdate' => 'js:function(id, data) {hideLoader();}',
));

My view contains 2 more CListViews. Is it possible to sort by this way ? Also my pagination is not working by Ajax.

Click Here to see the screenshot.

Please help.

0

There are 0 best solutions below