Welcome Guest, Not a member yet? Register   Sign In
Tree in CI
#1

[eluser]Unknown[/eluser]
I need to generate a tree in the following way.Is it possible in CI.HOw to do this in CI?

please check the attached image.
please help me
Thanks
#2

[eluser]Dyllon[/eluser]
That's more of a javascript task, jquery has several plugins available that will convert an unordered list into a collapsible tree.
#3

[eluser]kidsman[/eluser]
What about CI ? how CI handling tree data.HOw can we include CI and Jquery plugin for this?
#4

[eluser]tomcode[/eluser]
see the User Guide, html_helper, the list functions.

On the Wiki You should find some db solutions for nested sets.
#5

[eluser]kgill[/eluser]
I swear the question "Can I do this in CI?" gets asked often enough that I should just make this my sig. so all I have to do is an empty reply:
"CI is a just framework, not a language - it is still PHP, so if you can do it in PHP you can do it in CI."

CI has a few handy helpers and libraries to simplify things but for the most part, writing any of the complex code like this - you're supposed to do yourself. If you're lucky someone may have contributed a library but that's them sharing their code and not part of CI. Stop thinking of CI as some separate entity from PHP and just code like you would with PHP the only difference is you're breaking your code up into the different parts of a Model, View and Controller. CI is not some magic solution that will do everything for you, it's meant to help developers write apps not write them for them.

Now that said, google PHP tree traversal, store the data an multi-dimensional array. You're going to have to use recursion since you don't know how deep the structure is... so if you don't know what that is, start there.
#6

[eluser]kidsman[/eluser]
Thanks,
I have used MPTT in cakephp.Cakephp is having built in Tree support.What about CI.So
My question is CI has any built in support for generating tree format ( I mean in ul and Li style)
#7

[eluser]kgill[/eluser]
As has already been mentioned, look at the wiki for some user contributed solutions for nested sets. CI itself does not do any of this - if you need Cake-like features, use Cake. The two frameworks use different mindsets, CI's is essentially provide a basic framework and get out of the developer's way so they can do what they want.




Theme © iAndrew 2016 - Forum software by © MyBB