Hi,

I am using the Jquery Tree View using PHP. Its create the Tree view after then I want to add class for images (folder and files) can any body tell me that how to add images using Jquery.


PHP Code:
PHP Code:
<?PHP 
function createTree($array$currentParent$currLevel 0$prevLevel = -1) { 
                 foreach (
$array as $categoryId => $category) { 
              
                   if (
$currentParent == $category['ParentAccount']) {                         
  
                 if (
$currLevel $prevLevel) { echo " <ul> ";  } 
  
                 if (
$currLevel == $prevLevel) { echo " </li> ";} 
                  
                 echo 
'<li><span>'.$category['name'].'</span>'
  
                 if (
$currLevel $prevLevel) { $prevLevel $currLevel; } 
  
                 
$currLevel++;  
  
                  
createTree ($array$categoryId$currLevel$prevLevel); 
  
                  
$currLevel--;                   
               }     
  
             } 
  
    if (
$currLevel == $prevLevel) echo " </li>  </ul> "
  


?> 

   <ul id="browser"> 
    <li id="browser" class="filetree"><span>Vigour Impex</span><br /> 
        <?php createTree$arrayParent0); ?> 
    </li> 
</ul> 
<? 

                    $arrayParent
=array(); 
                         
$tableName=" GL_COA "
                    
$orderBy="AccountNO"
                                  
                    
$result1=$dbObject->select_All_Records_orderBy($tableName$orderBy); 
                    if (
$result1){ 

                    while(
$row mssql_fetch_array($result1)){  
                    
$fullName=$row['AccountTitle']." " .$row['AccountNO']; 
                     
                    
$arrayParent[$row['AccountNO']] = array("ParentAccount" => $row['ParentAccount'], "name" => $fullName);     
}                       } 
?>
here is JS


Code:
		$("#browser").treeview({
		animated: "medium",
		   collapsed: true

	
		});

I also tried to using this code to add class but its not work properly


Code:
$("#browser li:has(ul)").find(">span").addClass("folder");