i try to implement the CJuiAccordion. So i wrote a query Daytrip::model()->findAll(); this will give me object from Daytrip wich contains an id, title, city, distance, etc.
but i was expecting that you can parse the result of the query to the view and use it directly for the CJuiAccordion widget.
below you’ll find my work-around… i made my own <div> container with the exact same name as the widget will create. because i put the javascript code below my own <div> container the widget will make the first <div> the accordion div.
so my question is, how to use objects to fill the panel title and panel content.
Nor really an answer to your question, but thanks! This helped me create a simpler CJuiSortable solution, no need to put everything in an array to feed the widget.
$publication_panels=array();
if (count($model->publicationIssueSections)<=0){
echo 'There are currently no sections for Issue '.$model->publication_issue_id;
}else{
foreach($model->publicationIssueSections as $section){
$section_count=$section->PublicationBookCount;
$publication_panels[$section->section_name.' ('.$section_count.')']=$this->renderPartial('_overviewsection',array('section'=>$section),true);
}
}
$publication_panels['NEWPANELTITLE']='this is just another panel with inline <b>html</b>';
$this->widget('zii.widgets.jui.CJuiAccordion', array(
'panels'=>$publication_panels,
// additional javascript options for the accordion plugin
'options'=>array(
'active'=>false,
'collapsible'=>true,
'clearStyle'=>true
),
));