CTreeView with URL and state saving


If I am using CTreeView in AJAX-mode (setting the url property), can I get this widget to somehow keep current open nodes state over post-backs?


Does nobody understand the question? OR

Has nobody ever needed such thing? OR

Does nobody know if YII is capable of this?

??? :)

Hi Jackjack.

I tried CTreeViews and I notice that it doesn’t post anithig about open nodes.

If you want to do it is possible, but you have to implement by yourself.

You can add in ‘text’ property of your nodes an hidden field with the id of node, and then in post request work with this $_POST and generate your $data accordingly…

It looks like a bad workaround (and probably is it…), but is the most simple idea I have…

I did not succeed in getting CTreeView to work in mixed mode.

I supplied both the "data" and "url" parameters, and instead of the expected behavior, there was actually two widget rendered, one with constant data, the other working in AJAX mode.

I am not sure if this widget is prepared for such a use case, unfortunately.


What do you think about it?

You are right!!!

I tried and mine too worked like that… I think that there is no solution, because is impossible to create a "static tree" with url with only some leaves "dynamic" that uses ajax…

It’s a pity.