Bagam Jquery in Yii

Yii are deja implementat librariile jquery, ca sa includem un cod JS tre sa facem asa:



Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('page-grid', {
data: $(this).serialize()
});
return false;
});
");

Leave a Reply

Your email address will not be published. Required fields are marked *