pls help me with the logic for generating extjs tree dataurl

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

thanks in advance for all guys kindly help...
we are genrating the extjs tree
content for the tree has to be fetched from MySQL and the JSON has to
be composed using php

The general format for extjs tree url is as below...

icon :'/new_cms/cms/ext/resources/images/accord/page_green.png',

 i genrated this using following code...

This code works fine only for first level
if i insert a child to a the tree breaks up
pls help me with the correct logic
  or give me the link where  i can find help


The array variable $menu_name should be the text:
$tree_id[] is a reference like primary key
$menu_id[] decides the tree level
if the $menu_id is 1 or 2 or 3 ..... so on without any _(underscore)
its the first level..
if $menu_id is 1_1 then its the child of 1
if $menu_id is 1_2 then its the child of 1
if $menu_id is 1_1_1 then its the child of 1_1
feel free to ask any info about the coding and other issues





    $con= mysql_connect("localhost","root","");

    if (!$con)
        die('Could not connect: ' . mysql_error());

    $root = mysql_query("SELECT * FROM menu_managment_table where
menu_category='primary' ORDER BY tree_id ASC  ");
       while($row = mysql_fetch_assoc($root))

         $menu_name[$m]=$row['menu_name'] ;
    for($i=1;$i<=count($menu_id);$i++ )
        $var= array_search($str,$menu_id);
            $tpm= explode('_',$str);

            //echo $tpm_limit."<br>";





                    $qtip = 'Last Modified: '.$lastmod.'<br />Size: '.$size;

                    $tree_array[++$array_count]="{text:'".$menu_name[$var]."',icon :'/
                    $root_node[++$root_count]= $str;

                    $var1=rep($sub );



    function rep($sub )
    //echo $sub."<br>";

     global $tpm,$tpm_limit,$str,$menu_id,$var;
             $var= array_search($str,$menu_id);


                if( rep($str ))

                     return true;
                return true;
              return false;

            if (strncasecmp($root_node[$j],



       $tree_content= $new_sub.join('',$tree_array).$new_sub_end ;

    echo $tree_content;


Re: pls help me with the logic for generating extjs tree dataurl

On 26 Sep, 15:58, wrote:
Quoted text here. Click to load it

You haven't shared your schema.

Take a look at:

Site Timeline