MTreeView

I delete it after day of trying to customizing for my needs. Unfortunately code is not so good.

You could have asked a support from the forum instead of saying "code is not so good".

Could anyone of this discussion figure out how to use Ajax Links and (!) Ajax Tree combined?

I am having no luck so far.

Depending on my users’ permissions, they cannot view ALL the records in a table.

So I cannot simply do ‘table’=>‘menu_adjacency’, because that could give access to all records in the table.

Can MTreeView do something like this:

‘data’=>menu_adjacency::model()->getTreeItems(), which will allow me to filter the records?

Regards

At first - tis is GREAT extension - light and clean - just what I need! So thank You!

But I have one question: how can I pass usual GET parameters to controllers in ‘url’?

I used to use




array('admin/category/targetparentid&into_model=News',array('id'=>'id'));



and then parsed it in controller to render necessary view (i.e. of "News" model)

I did it because this code didn’t work:




array('admin/category/targetparentid',array('id'=>'id','into_model'=>'News'));



  • MTreeView tries to attach “News” filed in select statement (which doesn’t exist) so I have Exception.

My first workaround worked fine until I turned on Urls PATH format :))))

So I had to create 3 almost identical controllers to workaround it, like:




array('admin/category/targetparentid_news',array('id'=>'id'));



etc.

What’s the right way to pass one more GET parametr in ‘url’ of MTreeView?

Thanx in advance!

To whom it may concern…

There is a problem in this code:

I have a table organized in a ‘Nested Sets Model’ context.

In order to turn this linear table into a multidimensional array, this extension creates a SQL-statment which uses the ‘COUNT’ and ‘GROUP BY’ directives and the ‘text’ field to get the ‘depth’ value of every node.

There is no problem and works very well as long as every node has a different ‘text’ field (-> unique).

If two nodes share the same ‘text’, the resulting multidimensional array gets messed up because ‘depth’ is calculated wrong.

The solution for me was to replace the ‘text’ field in ‘COUNT’ and ‘GROUP BY’ directives with the ‘id’ field (which is the primary key) and now everything works fine.

CU

Wow, what a great guy and great extension. Is it possible that you will include support for closure tables in the future? Case: nestedSet, adjacency, closure, and maybe pathEnumeration? Only the query building will be different for all of them i think :). That would make it quite complete extension for any data hierarchy management. Thanks again you rock.