jsTree jQuery plugin vs Codeigniter (nodes with children not showing up) |
You can use this code.
HTML Code: <ul> <li>Business <ul> <li>Leo Rodriguez</li> </ul> </li> <li>Computer Science <ul> <li>Harry Jones</li> <li>Sabi</li> </ul> </li> </li> <li>IT <ul> <li>Tim Ben</li> </ul> </li> <li>Marketing <ul> <li>John Doe</li> </ul> </li> </ul> PHP Code: <ul> <?php foreach ($users as $key => $value) { ?> <?php if($users[$key]['department'] != $users[$key-1]['department']) { ?> <li><?php echo $users[$key]['department']; ?></li> <ul> <li><?php echo $users[$key]['fullname']; ?></li> </ul> <?php } else { ?> <ul> <li>Sabi</li> </ul> <?php } ?> <?php } ?> </ul> |
Messages In This Thread |
jsTree jQuery plugin vs Codeigniter (nodes with children not showing up) - by sabimofler - 12-30-2017, 11:51 AM
RE: jsTree jQuery plugin vs Codeigniter (nodes with children not showing up) - by PaulD - 12-30-2017, 12:35 PM
RE: jsTree jQuery plugin vs Codeigniter (nodes with children not showing up) - by sabimofler - 12-30-2017, 04:00 PM
RE: jsTree jQuery plugin vs Codeigniter (nodes with children not showing up) - by XtreemDeveloper - 12-31-2017, 11:51 PM
|