Benn
(B Destrube)
1
Hello!
Does anyone know how to get a CJuiButton to look like the first one on this page :
http://jqueryui.com/demos/button/#icons ?
Not specifically that icon, but just, to get the icons to work.
I’ve tried this, but no success…
$form->widget('zii.widgets.jui.CJuiButton', array(
'name'=>'myButton',
'options'=>array(
'icons'=>array(
'primary'=>'ui-icon-triangle-1-s',
)
),
'onclick'=>'js:function(){
alert('test');
return false;}',
)
);
Thanks a lot!
ahmed
(Ahmed Henteti)
2
a find a mistake near alert(‘test’);
try this :
$form->widget(‘zii.widgets.jui.CJuiButton’, array(
'name'=>'myButton',
'options'=>array(
'icons'=>array(
'primary'=>'ui-icon-triangle-1-s',
)
),
'onclick'=>'js:function(){
alert("test");
return false;}',
)
);
Benn
(B Destrube)
3
My bad, that’s actually what I had written in my code, but still no icon… 
ahmed
(Ahmed Henteti)
4
strange cause it work on my pc…
try this
$form->widget(‘zii.widgets.jui.CJuiButton’, array(
‘name’=>‘myButton’,
‘caption’=>‘eee’,
‘options’=>array(
‘icons’=>array(
‘primary’=>‘ui-icon-triangle-1-s’,
)
),
‘onclick’=>'js:function(){
alert("test");
return false;}’,
)
);
or follow documentation
http://code.google.com/p/yii/source/browse/tags/1.1.6/framework/zii/widgets/jui/CJuiButton.php
Benn
(B Destrube)
5
Here’s what i get… any ideas?
Benn
(B Destrube)
6
Got it fixed thanks to rawtaz on the chat 
It was silly of me not to see it really :
$form->widget('zii.widgets.jui.CJuiButton', array(
'name'=>'myButton',
'buttonType'=>'button', // this was needed
'options'=>array(
'icons'=>array(
'primary'=>'ui-icon-triangle-1-s',
)
),
'onclick'=>'js:function(){
alert('test');
return false;}',
)
);