Welcome Guest, Not a member yet? Register   Sign In
Nested View
#1

[eluser]Niraj Dave[/eluser]
jquery & CI_NESTED_SET
#2

[eluser]markup2go[/eluser]
Care to elaborate? lol.
#3

[eluser]BrianDHall[/eluser]
If you need a flow-chart to keep track of the nesting of your views, you are doing it wrong. Wink
#4

[eluser]Niraj Dave[/eluser]
thanks for reply

i am not good in programming and english. when i need to make organization chart, i found ci nested set and jquey. i havu

i have changed some code in function in model: of CI NESTED SET (category_demo).
and adding jquery file.
Code:
function getSubTreeAsHTML($node, $fields = array())

    {
            

        $tree_handle = $this->getTreePreorder($node);
        $retVal = "";
        $i = -1;
          

        while($this->getTreeNext($tree_handle))

        {    
                $ii = $this->getTreeLevel($tree_handle);
            
                /////////
                if($i<$ii)          { $retVal .= (str_repeat("<ul class=\"org-chart\"><li>", 1  ));}
                if($i>$ii)          { $retVal .= (str_repeat("</li></ul>", ($i-$ii))).(str_repeat("</li><li>", 1  ));}
                if(($i-$ii)== 0)     { $retVal .= (str_repeat("</li><li>", 1));}
            

            // print requested fields

            $field = reset($fields);

            while($field){

                $retVal .= "<div style=\"color:red\">".$tree_handle['row'][$field]."</div>" ."\n" ;

                $field = next($fields);

            }
            

            $i = $ii;
      

        }
        
             $retVal .= (str_repeat("</li></ul>", $this->getTreeLevel($tree_handle)*1));
        

        return $retVal;

    }


it works good as i expect.




Theme © iAndrew 2016 - Forum software by © MyBB