Reputation: 2915
I have the following CListView
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$ligas,
'viewData'=>array('joinedArray'=>$joinedArray),
'pager' => array(
'prevPageLabel'=>'< Prev',
'nextPageLabel'=>'Next >',
'header'=>'Page: ',
'pageSize'=>5,),
'itemView'=>'_viewSearch',
'emptyText'=>'empty',
'afterAjaxUpdate'=>'js:paintMyLigas()',
'template'=>"{items}\n{pager}", //template
'pagerCssClass'=>'page-number',//contain class
'id'=>'idCListView',
));
And then a javascript function which is supposed to trigger an ajax update on this list
function updateList(){
$.fn.yiiListView.update('idCListView');
}
I get the following error: $.fn.yiiListView is undefined
Any ideas? pls i need help!! :) Thanks in advance
Edit @ldg , there are several js files being included and since (evidently) I am no expert with html and web programming in general, i added all those which seemed relevant.
<script type="text/javascript" src="/../../Javascript/main/main.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/../../images/advertisementSpaces/swfobject.js"></script>
<script type="text/javascript" src="/assets/93fda158/jquery.js"></script>
<script type='text/javascript' src='../../Javascript/main/jquery.min.js'></script>
<script type="text/javascript" src="../../Javascript/main/floating.js"></script>
<script type="text/javascript" src="/assets/93fda158/jui/js/jquery-ui.min.js"></script>
Do you notice any conflicts here that could lead to this error?
Upvotes: 0
Views: 3318
Reputation: 9402
Default functionality would be to render the page with something like:
<script type="text/javascript" src="/assets/5764d9e2/jquery.js"></script>
in the header, and:
<script type="text/javascript" src="/assets/a488eed5/listview/jquery.yiilistview.js"></script>
in the footer. There might be some others as well, like "jquery.ba-bbq.js", etc. The version of jQuery will depend on the Yii version you are using (current is 1.6), so it could be causing problems if you are loading two versions of jQuery. As mentioned, check the rendered source to see what js has been included.
You should also see a generated jQuery function in the footer including something like a "yiiListView" function to init the pager and sorter, etc. -- if not, that could also indicate a problem.
Upvotes: 1