CJuiButton

Hi Yii-friends!

I use jquery-ui theming system, and CJuiButton widget for all my buttons.

I’ve little issues.

The name/id property should be automatic like CHtml::*buttons methods, so that if I render partial more than one form in the same page, buttons can be themed in the right way and not only the first one. In these cases I have to change name property so that CJuiButton will generate another js call to create the themed button.

Another issue. Using CJuiButton, for example in CListView component with pager. If ajax is enabled, ui-buttons will be unthemed at every page click.

Any ideas?

Hi makro,

I had this same problem and solved it by using the afterAjaxUpdate parameter in CListView




$this->widget('zii.widgets.CListView', array(

		'dataProvider'=>$dataProvider,

		'itemView'=>'_view',

		'afterAjaxUpdate'=>'function(id, data){$(".cart_update").button();}',

));



Where .cart_update is the class I added to each CJuiButton, seems like a bit of a hack way to do it.

Anyone have a better solution for this problem?

Thank you very much for your suggestion!

But I think the name should be automatic by default as “normal” CHtml::*button methods… isn’t it?