yiinfinite-scroll and afterAjaxUpdate

I’m using yiinfinite-scroll with CListView, it works ok, but my problem is that the event afterAjaxUpdate is not working.

My code is this:




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

        // Default CListView configuration

        'dataProvider'=>$dataProvider,

        'itemView'=>$itemViewName,

        'afterAjaxUpdate'=> 'function(id, data){alert(\'hello, ajax was called\');}',

        

        // Custom Infinite Scroller pagination

        'id'=>'list-identifier',

        'pager'=>array(

            'class'=>'ext.yiinfinite-scroll.YiinfiniteScroller',

            'contentSelector' => '#posts',

            'itemSelector' => 'div.post',

        )

    ));



Any idea about how to make it work?




'afterAjaxUpdate'=>"js:function () {

      afterAjaxUpdate(); // or just alert('ajax loaded');

    }",


<script type="text/javascript">

function afterAjaxUpdate(){

         alert('ajax loaded');

};

</script>



its easier to read if you put it in a seperate function, depends on how much you have to run.

Did you solve it? If yes, would you mind sharing the solution here? I got the same problem.

I know this is an old thread, but here is how to do it (just in case someone finds this post looking for help):




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

        // Default CListView configuration

        'dataProvider'=>$dataProvider,

        'itemView'=>$itemViewName,

        'ajaxUpdate' => false,

        'template' => '{items}{pager}', //removes summary and sorter

        // Custom Infinite Scroller pagination

        'id'=>'list-identifier',

        'pager'=>array(

            'class'=>'ext.yiinfinite-scroll.YiinfiniteScroller',

            'contentSelector' => '#posts',

            'itemSelector' => 'div.post',

            'contentLoadedCallback' => 'js:function() { alert("Content loaded!"); }'

        )

    ));



This is a new feature added Yiinfinite-scroller 1.3

This is really nice extension. Works Perfectly. But i want some modification. It scroll data when page scrolls, but i want it in a div scrolling.

Thanx in Advance…

Any Solution?