Cjuiaccordion In Ajax Call (Cjuidialog)

I am using CJuiDialog to open a dialog on click and populate it with content retrieved with an ajax call:




CHtml::ajaxLink(

            $text,

            CHtml::normalizeUrl ($ajaxUrl),

            array (

                'success'=>'function(html){

                    $("#'.$dialogID.'").html(html);

                    $("#'.$dialogID.'").dialog("open");

                }',

            ),  

            array (

                'href'=>CHtml::normalizeUrl($url),

                'target'=>'_blank',

            )   

        );  



Now, in this ajax call, renderPartial is used to create an CJuiAccordion. However, the Accordion doesn’t work, I just get the plain HTML code. I assume that since it’s an ajax call with renderPartial, the jQuery code doesn’t get included and executed.

Is there a simple way to achieve this?

Thanks!

I found out :)

In case, somebody else has the same problem, adding the accordion call in the "success" callback does the trick:




CHtml::ajaxLink(

            $text,

            CHtml::normalizeUrl ($ajaxUrl),

            array (

                'success'=>'function(html){

                    $("#'.$dialogID.'").html(html);

                    $("#'.$dialogID.'").dialog("open");

                    $("#your-accordion-id").accordion([]);

                }',

            ),  

            array (

                'href'=>CHtml::normalizeUrl($url),

                'target'=>'_blank',

            )   

        );




Thanks!!

I had the same problem

Luca

Thanks, Thanks, Thanks