Icon CJuiButton

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!

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;}',


)

);

My bad, that’s actually what I had written in my code, but still no icon… :)

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

Here’s what i get… any ideas?

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;}',

    )

);