does JUI Widgets automatically registering jQuery UI script?

Hi,

my application contains about different parts, which are loaded by using ajax.

One of those parts contains CJuiDatePicker, CJuiAutoComplete, CJuiDialog, CJuiSliderInput.

Watching firebug i can see, that jquery-ui.min.js is loading automatically/implicit. Could this be possible?

If it is so: is it possible to disable the automatic loading of jQuery UI?

Because: an other part of my web-applications contains an list of div’s an some registerScripts to make those div’s draggable and droppable.

But if the 1st part (with CJuiDatePicker, CJuiAutoComplete, CJuiDialog, CJuiSliderInput) is loaded after the “Drag’n drop” part, so jQuery-ui seems to be initialized a 2nd time. The problem is now: the drag’n drop does net work anymore - probably there is something overwritten while loading jQuery UI ones again.

So now I would like to load/register jQuery ui only one time on an central part of my application.

Therefore ones again my question: is it possible to avoid implicit loading jQuery UI by those JUI Widgets?

Thank you. :slight_smile:

//Edit: ist scriptFile=>flase the right way??

http://www.yiiframework.com/doc/api/1.1/CJuiWidget#scriptFile-detail

If yes: how could i check und Ajax Request for Part 2 if jQuery UI is still loaded by an ajax Request before?

I’m not an expert but I think the scriptFile => false is the only way to avoid duplicate loading of js files.

There is an extension nlsclientscript which could be helpful.

Can you post your solution if you have one cause i’m also interested to know how exactly to avoid this problem.

Hi,

right: the widget will not load jQuery UI (again), if you set scriptFile => false.

So my solution is to register jQuery UI onces at an global position and setting scriptFile => false on each widget.

That work’s for me, because I need jQuery UI on every webpage.

Probably it will be a bit more complicated, if you need jQuery UI only in special cases. Than you have to decide "to load or not to load" jQuery UI.

:slight_smile: