I have a form with some widgets on it. One is an autocomplete, another is a multiselect box. I would like to load the form with an ajaxLink. But when the form loads, the jQuery code does not work because the widgets rely on the ready() function to attach the jQuery code. Is there a way to create widgets so that they behave properly when loaded through ajax?
I had the same problem. I solved it for now but still looking for better solution.
I copied Autocomplete code (which Yii generates at not-ajax page), removed ready() function and created my own. When form is loaded by ajax request I just call my function which creates Autocomplete widget. I also should include Autocomplete js and css files manually.
I think I found the solution. renderPartial() has a processOutput flag. If this is set to true, then the script is included so that it runs after an ajax load. I tried it and the autocomplete on my ajax-loaded form worked perfectly.