Refreshing gridview Table on the certain intervals. Like mail client's mail boxes
Requirements ¶
Yii 1.1 or above
PHP 5 above
Usage ¶
Copy the LiveGridView folder into protected/extensions/
$this->widget('application.extensions.LiveGridView.RefreshGridView', array(
'id'=>'items-grid',
'dataProvider'=>$model->search(),
'updatingTime'=>6000, // 6 sec
'filter'=>$model,
'columns'=>array(
...
array(
'class'=>'CButtonColumn',
),
),
));
Add a demo
Could you add a demo ?
This sounds usefull
Problem with the jquery selector
Firstly I would like to say great extension. Something I have been looking for for a while. However I did have to modify the code of RefreshGridView.php on Line 46 & 47
$cs->registerScript( __CLASS__.'# '.$id,"jQuery('# $id').yiiLiveGridView();" ); $cs->registerScript( __CLASS__.'# '.$id.'-live',"setInterval(function(){;$.fn.yiiLiveGridView.update( '$id', ". CJavaScript::encode($updateParameters) .");}, {$this->updatingTime});"
to
$cs->registerScript( __CLASS__.'#'.$id,"jQuery('#$id').yiiLiveGridView();" ); $cs->registerScript( __CLASS__.'#'.$id.'-live',"setInterval(function(){;$.fn.yiiLiveGridView.update( '$id', ". CJavaScript::encode($updateParameters) .");}, {$this->updatingTime});"
As the extra spaces were causing jquery to be unable to locate the element by id.
I also changed line 17 to extend TBGridview to take advantage of yiibooster but this is a personal preference :D
selectCheckedRows(v) problem
Hi, I tried this extension with yii's default admin controller action. My console error log is:
TypeError: $.fn.yiiGridView.selectCheckedRows is not a function
$.fn.yiiGridView.selectCheckedRows(v);
Please help
(update1: grid refreshing works anyway, so my question is just about this error log, I am courious what that means)
(update2: commenting out row 23 at the yiilivegridview.js file, error log dissapears)
Thank You
Laszlo from Hungary
Works like a charm
I love it when an extension just integrates so smoothly with Yii and works out of the box perfectly!
Nicely done!
@Nisanth thulasi
Good Work
@chango08
Thanks, great work!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.