The question is… how do i provide a different template?
This is not working
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name' => 'elementos_select',
'itemTemplate' => '<li id="elemento_{id}">{content}</li>',
'value' => '',
'source' => $this->createUrl('elemento/list'),
'options' => array(
'showAnim' => 'fold',
//los eventos de este, por claridad, los voy a poner directamente en el js (coaster_modificar.js) tal y como aparece en la documentación de jqueryui
)
)
);
I agree with mdomba, in your first example you put the items directly, on the second you use the ‘source’ property. I recommend you to do the first example like the following to test it
$this->widget('zii.widget.jui.CJuiSortable', array(
'items' => $elementos, // <--- elements like this first!
'id' => 'elementos_lista',
'itemTemplate' => '<li id="elemento_{id}">{content}</li>',
'options' => array(
'delay' => '300'
)
));
And if it works, then try with the source property!
As you can see on this line of code here, to change the itemTemplate isn’t rocket science (review it carefully, I am sure you will do it!)
im using sortable in that way, but i dont know how to change the code that if generates. I supose i have to use itemTemplate, but i dont know how to use it in the widget (first time use).