The problem is detailed here:
http://www.yiiframew…rid#entry110230
The patch to solve this problem is:
--- assets/gridview/jquery.yiigridview.js (revisión: 332)
+++ assets/gridview/jquery.yiigridview.js (copia de trabajo)
@@ -41,6 +41,18 @@
}
var inputSelector='#'+id+' .'+settings.filterClass+' input, '+'#'+id+' .'+settings.filterClass+' select';
+ $('body').undelegate(inputSelector, 'keydown').delegate(inputSelector, 'keydown', function(k){
+ if (k.keyCode == 13) {
+ var data = $(inputSelector).serialize();
+ if(settings.pageVar!==undefined)
+ data += '&'+settings.pageVar+'=1';
+ $.fn.yiigridview.update(id, {data: data});
+ return false;
+ }
+ else {
+ return k;
+ }
+ });
$('body').undelegate(inputSelector, 'change').delegate(inputSelector, 'change', function(){
var data = $(inputSelector).serialize();
if(settings.pageVar!==undefined)
So, if you have a CGridView inside a CForm or CActiveForm, the form won’t be submitted when you press enter in a filter text field, but the search will be performed.
Please consider including it the official source code.