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