i have some table in YII that uses CGridView. I want to be able to enter all filtering data and then click on some button and only then send request to server. Right now request is sent every time filter value changes. Is there any native Yii CGridView option to specify that?
Insert this after CGridView widget:
Yii::app()->clientScript->registerScript('gridFilter',"
$(function(){
$(document).off('change.yiiGridView keydown.yiiGridView');
$('body').on('click','.updateGridButtonSelector', function() {
$('#grid_id').yiiGridView('update', {
data: $('#grid_id .filters input').serialize()
});
return false;
});
});
", CClientScript::POS_READY);
See here: http://www.yiiframework.com/doc/api/1.1/CGridView and here: http://www.yiiframework.com/forum/index.php/topic/7320-how-to-disable-ajax-in-cgridview-or-clistview/
Try with ajaxUpdate=>'false'
in the widget declaration.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.