When updating the versiona the framework 1.1.14 to 1.1.17, we are having enough trouble with jquery, because the version is updated to 1.11.
Old. Version
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$('#grupos-grid').yiiGridView('update', {
data: $(this).serialize()
});
return false;
});
$('#grupos-grid table tbody tr').live('click',(function(){
var ll = $(this).find('td:eq(0)').html();
var lg = $(this).find('td:eq(2)').html();
window.location.href = 'index.php?r=equipo/admin&IdGrupo=' + ll +'&nombreGrupo=' + lg;
}));
$('#yw2').hide();
");
New versión - Adapted to new versión jquery
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$('#grupos-grid').yiiGridView('update', {
data: $(this).serialize()
});
return false;
});
$('#grupos-grid').on('click','table.items tbody tr',(function(){
var ll = $(this).find('td:eq(0)').html();
var lg = $(this).find('td:eq(2)').html();
window.location.href = 'index.php?r=equipo/admin&IdGrupo=' + ll +'&nombreGrupo=' + lg;
}));
$('#yw2').hide();
");
What makes the javascript is to click on the line, it forwards to another page.
It works well, but if a search is performed on the grid code stops working.
Any Idea?
Tranks