CHtml::ajaxLink with onclick event present


In a view, I have a dialog box -hidden- which should pop up with contents that are loaded with an ajax call.

I use the following code:

    print CHtml::ajaxLink('select circles', array('ajax/circle.CircleSelector'),





            'onclick'=>'$("#mydialog").dialog("open"); return false;',

    //       'onmouseup'=>'$("#mydialog").dialog("open"); return false;',



Problem is it does not work; only the dialog pop up works and ajax part doesn’t. Seems to me that the CHtml::ajaxLink sets the onclick property of the link for ajax call first, and my onclick code overrides it. If it change the event from onclick to something else -onmouseup, for example- both will work fine.

Do you have any suggestion for solving this problem?

Give the code it generates,

I would just write all the stuff manually if I was in your place…

update uses on click event, the update finishes and then the dialog created

I didn’t get it completely. Do you mean that I avoid using Chtml::ajaxLink and instead, I write my own jquery ajax and the rest?