Change yii dialog widget title onclick event

How would I change the title on a yii dialog widget on the click event?

Thanks, Mike

Hello. Maybe you should post at least your widget code?

It is just a basic, out of the box, widget. I want to change this title on a onclick event.




$this->beginWidget('zii.widgets.jui.CJuiDialog', array( 

  'id'=>'tokDialog', 

  'options'=>array( 

  'title'=>'New Title Here', 

  'autoOpen'=>false, 

  'modal'=>true, 

  'buttons'=>array( 

    'Add Item'=>'js:addItem', 

    'Cancel'=>'js:function(){ $(this).dialog("close");}', 

  ), 

));



So if I get it, it’s basically it’s a JS question… If you see the code generated by Yii through jQuery UI Dialog, you’ll find that in your case, the title lies into a div with id=[font=“Courier New”]ui-dialog-title-tokDialog[/font] (or something like that). So I guess you can take it from here…

Ok. I see. Not sure why I didn’t think about that. I’ve been looking for some sort of built-in way of doing things.

Thanks.

Mike

In javascript:




$('#tokDialog').dialog({title:'new title'});

$('#tokDialog').dialog('open');