renderPartial using widget

I’ve got question about renderPartial.

I got widget, that displays help-tutorial of how to use my site, using jquery dialog.

What i need is - wait till user presses ‘OK’, or other button, then re-render it’s (dialog’s) content acording to pressed button.

My question is - Is there native YII way to use AJAX requests to re-render content in widget.

Many thx in advance.

Does it help you?

Thx for reply, but nope, didn’t help, because i need to juct render widget, and don’t want to use controller.

I narowed down my problem to one task. I need to be able to render widget bu request.

Still thinking…

I don’t know if this will help you, but… I would forget about Yii (and server-side) at all in this case. After all - if I’m not getting you wrote - you want to change (re-render) widget contents after users clicks OK in some dialog. Both dialog, OK button and widget contents are client-side matters.

In other words, I would simple hire jQuery to do that. In your widget, surround everything you later want to re-render with some div and give it a unique id. Then write jQuery onClick handler that will react on user clicking on OK button and in that handler (JS function) simply change contents of that div by calling:


and point your ajax_function to a specific Yii action, which would return whatever you want to put into that div. And in that action use renderPartial to return contents as you would return in any normal AJAX-call return.

At least I would look somewhere in this way.

There is not a native yii way, but you can take a look at this wiki.