How do you make CListview pagination load data page 2, 3, etc from partial ?

I noticed when looking in the firebug in the net tab that the CListview ajax pagination actually requests the whole page, and somehow then extracts and switches the CListview from the returned page and updates it on the DOM (or something like that).

(If you click on the little [+] sign and open the GET request, and then click on the Response panel, or the HTNL panel, you can see the response of the GET request)

Is there a way to make it use a different url for ajax update than the currrent url, so that I can use a partial for outputing the next pages , as oposed to rendering the whole template ?

Use your own ajax function that retrieve the partial, Yii components are not always a good choice for some purposes…




...

// pagination

$('#content .article-pager li a').live('click', function()

 {

		if($(this).parent('li').hasClass('hidden')) return false;

		if($(this).parent('li').hasClass('selected')) return false;

			

    		var link = $(this).attr('href');

    		ajax_get_listing(link);	

	    	

	    	return false;

});	


// sorter

$('.product-sorter ul li a').live('click', function()

     {

        	var link = $(this).attr('href');

        	ajax_get_listing(link);

        			   	    	    	

    	    	return false;

 });	


function ajax_get_listing(link)

{

	jQuery.ajax({

		'type': "POST",

		'cache': false,

		'url': link,

	   	'data': '',

	   	'success': function(data){

	   		$('#content').html(data);   			

	   }

	});

};


...



Or I guess you may extends CListview and re-write the js code but that would take more time.