Yii Jquery Conflict With Jqwidgets Jquery

Hello. Please help, I’m using Yii with jqwidgets and got some difficulties.

I use jqxtree with jqxtabs, so everytime user click menu on the left, it will open a new tab, which content is loaded via AJAX. e.g I click on User menu, it will show list of user, using jqxgrid ( page list.php ) and on list.php I have a button, which if clicked will load user’s form.php via AJAX and located at the top of the grid. The form has been loaded successfully, but the jqx functions on form.php does not work. Here is the code :




<?php Yii::app()

	            ->clientScript

				->registerScript('responsive-page-'.uniqid(),'

					var theme = "'.Yii::app()->params['theme'].'";

					$(document).ready(function() {

						$("#user-submit-btn").jqxButton({ theme: theme, width: "80px"});

						$("#user-submit-btn").on("click",function() {

							userGrid.jqxGrid("updatebounddata");

						});

					});

			',CClientScript::POS_HEAD); ?>



But I got error on firebug saying :

Uncaught TypeError: Object [object Object] has no method ‘jqxButton’

(anonymous function)

fire

self.fireWith

jQuery.extend.ready

I found out that if I set scriptMap to false in my controller, the jqWidgets function works but the form validation not working. So it is likely that the javascript is conflict.

Anyone know how to solve this ? Thank you

you can just pass the proecessOutput on page rebderPartial (false,true)

like


$this->renderPartail('index',array('model'=>$model),false,true)

Thank you for the reply. Yes, I’ve done so but still not working. In my form, I’m using tabular input extension, which require .live() function and since I disable jquery.js in my controller, it become error and the form validation stop working. If I delete the tabular input, the validation works. Is there another solution for this ? Thank you

Problem solved. I managed to include jQuery but the .live() method is obsolete so I changed the extension to using .on(“click”, … ) and now it works :)

Ok cool :rolleyes: