Welcome Guest, Not a member yet? Register   Sign In
Want help to use jquery tree view
#1

[eluser]Mistry007[/eluser]
hi i am using jquery tree view for display the tree stracture. now i want some help.
I have generated the tree without jquery tree view. it display well with folowing code.
Code:
global $menu_array ;
foreach ($result as $rowdata)
{
$menu_array[$rowdata->course_id] = array(
  'id' => $rowdata->course_id,
  'category' => $rowdata->course_name,
         'parent_id' => $rowdata->parent_id );
}
generate_menu($menu_array,0);
function generate_menu($arr, $parent)
{    
    $has_childs = false;
    foreach($arr as $key => $value)
    {
if ($value['parent_id'] == $parent)
        {      
  if ($has_childs === false)
  {
       $has_childs = true;
  echo '<ul id="browser" class="treeview">';
  }
echo '<li class="expandable"><div class="hitarea expandable-hitarea"></div><a href="/url/' . $value['category'] . '" title="">' . $value['category'] . '</a>';
generate_menu($arr, $key);

echo '</li>';
}
}
if ($has_childs === true) echo '</ul>';
}

now this will generate the tree stracture now i want to represent this result into jquery tree view how can i change it. i want to use this plugin http://jquery.bassistance.de/treeview/demo/
Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB