Jquery pagination error

Hi,

I have a page the has an ajax load method.


Yii::app()->clientScript->registerScript('test'," $('#test').load('".$this->createUrl('/test/assign', array('id'=>$id))."', null, loadingH('#test')); loadingS('#test');"

  );

<div id="test">

  <div class="loader" style="display: none"><img src="/images/loading.gif"></div>

</div>

It links to a page that has a CListView with pagination


$itemClick = "function(id, data) {  $('div.view-pt').click(function() { window.location=$(this).find('a').attr('href');  return false; }) }";

$this->widget('zii.widgets.CListView', array(

    'dataProvider'=>$dataProviderDoc,

    'itemView'=>'_assign',

    'template'=>'{items}<div class="p-pager">{pager}</div>',

    'id'=>'ad',

    'ajaxUpdate'=>true,

    'afterAjaxUpdate'=>$itemClick,

    'enablePagination'=>true

    'pager' => array (

        'class' => 'CustomLinkPager', 

        'cssFile' => false,

        'maxButtonCount' => 0,

    ),  

)); 

~

The problem I have is the pagination works most of the time, but every now and then I get a jQuery merge error.

The result is the pagination when click sends me the the page and does not run the ajax call.

Which exactly error do you get?

All Firebug reports is a


jQuery.merge(x, y) {

Unfortunately no other information comes through it just stops at the "{".

Hello

You should prefix your afterAjaxUpdate value with ‘js:’ since it’s a JS function:


'afterAjaxUpdate' => 'js:' . $itemClick,

Edit: or of course prefix your $itemClick variable value with it :)