I want to ask does fn.yiiGridView.update render the entire page when called or just grid view table?


it will only update the CGridview bcoz u r specifying the grid id inside the update function.

$.fn.Yiigridview.update(‘grid id’);

Hi Prat

I does render the whole page and some javascript magic to update the grid.

Set the ajaxUpdate property

ok currently I am calling fn.yiigridview.update after every 10 seconds to update cgridview. Is it possible that cgridview is updated only when some changes takes place in database.


$page_refresh_time = 10000;

Yii::app()->clientScript->registerScript('refresh_page', "interval;

function refreshGrid(){

if($('a[href=\"#dash2\"]').is(':visible')) {


var interval = setInterval(refreshGrid, $page_refresh_time);");



Dont refresh for every 10seconds…instead check the difference between database and cgridview records for every 10seconds. If its differ then refresh your cgridview.

You can compare the activerecords using below code


Thanks to thyseus for his solution


chandran nepolean