Hey
I use an ajax form to add items to a list on a page. After the ajax submit I update both the grid list and the select input of the form, to show only the difference between the list and the select’s options.
So I used ‘ajaxUpdate’ property with a comma separated list to update multiple selects on my page.
r2848 broke it because it calls selectCheckedRows() on all of the items set in ‘ajaxUpdate’.
The js error is settings is undefined
So I had to modify the function
$.fn.yiiGridView.selectCheckedRows = function(id) {
var settings = $.fn.yiiGridView.settings[id];
$('#'+id+' .'+settings.tableClass+' > tbody > tr > td >input.select-on-check').each(function(){
if($(this).attr('checked'))
$(this).parent().parent().addClass('selected');
});
};
to this
$.fn.yiiGridView.selectCheckedRows = function(id) {
var settings = $.fn.yiiGridView.settings[id];
if (settings == undefined) return;
$('#'+id+' .'+settings.tableClass+' > tbody > tr > td >input.select-on-check').each(function(){
if($(this).attr('checked'))
$(this).parent().parent().addClass('selected');
});
};
Should this be reported as a bug?