Tengo debajo de CJuiAutoComplete y al cargar Quiero mostrar "Buscar" en el campo de texto y al hacer clic quiero borrar. Intenté usar "valor" en las opciones, pero no pude hacerlo funcionar. Gracias por su ayudaYii CJuiAutoComplete el valor de visualización predeterminado y borrarlo al hacer clic
intentó también
'htmlOptions'=>array('value'=>'Search',)
<?php
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'test1',
'source'=>'js: function(request, response) {
$.ajax({
url: "'.$this->createUrl('myAutoComplete/autoCompleate').'",
dataType: "json",
data: {
term: request.term,
brand: $("#type").val()
},
success: function (data) {
response(data);
}
})
}',
'options' => array(
'showAnim' => 'fold',
'select' => 'js:function(event, ui){ alert(ui.item.value) }',
'click'=>'js:function(event, ui) {
alert("test");
return false;
}',
),
'htmlOptions'=>array('value'=>'Search',)
));
?>
Saludos
ACTUALIZACIÓN
'valor' poner directamente => 'Buscar' funcionó.
la comprobación de controlador de clic
Kiran
También puede usar el atributo "marcador de posición" en htmloptions, aunque no es compatible con todos los navegadores. – ldg