N
N
NOCaut2015-10-30 19:56:11
Yii
NOCaut, 2015-10-30 19:56:11

How to set search filter in ListView + pjax?

function render(param, value){
  $.pjax({
        type       : 'POST',
        url        : updateQueryStringParameter(window.location.href, param, value),
        container  : '#countries',
        data       : {},
        push       : true,
        replace    : false,
        timeout    : 10000,
        "scrollTo" : false
    })
}
...

 <?php Pjax::begin(['id' => 'countries']);
                echo ListView::widget([
                'dataProvider' => $dataProvider,
                'itemOptions' => ['class' => 'item'],
                'itemView' =>  '_view',
                ....
            ]);
            Pjax::end();?>
        </div>

render('pageSize', 2); - works fine
render('myid', 2); - error
[/code]
For me, pjax:error returns request.statusText == "abort" jqXHR.status === 0
when the pageSize parameter is used - it doesn't swear. and as soon as I set the parameter for the search I get an error.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question