Page 1 of 1

KoolPHP tools and problems

Posted: Thu Jul 02, 2009 7:31 pm
by GTGeek88
I'm trying to use KoolTreeView from KoolPHP.net and am having some troubles. Don't know whether to attribute it to their tool or something else. One odd thing is that if I do a number of screen refreshes, some of those will have errors. I'm using Firebug in Firefox and it seems to be reporting that not all of the JavaScript that KoolTreeView creates is making it to the browser. What Firebug shows me is just cut off. I'm not sure if this is a limitation of Firebug, though I wouldn't think so, or if something is actually causing the code to be truncated. It may be a problem with my PHP installation (IIS 5 on WinXP SP3 on my local dev machine). I tried the installer, but it just didn't work. I did a manual install and it seems ok, but it's still a question, I suppose. Anyway, if the code is truncated, it's obviously not going to work, but how could I figure out what the culprit is here? Very new to PHP, BTW.

UPDATE:

I am now assuming this is am iFrame problem. I am trying to use AJAX to call the page and inject the results. I am using this code:

Code:

Code: Select all

 
<script type="text/javascript">
 
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
 
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
 
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
 
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
 
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
 
</script>
 
and I am calling this via the onLoad event in the Body tag:

Code:

Code: Select all

 
<body onload="ajaxpage('treemenu.php', 'treeview')">
 
The code above places the HTML in the treeview div defined like this:

Code:

Code: Select all

 
<td>
   <div id="treeview" style="height: 386px; width: 894px">&nbsp;</div>
</td>
 
I'm getting a partial tree. It displays the root and the three folder nodes (the root and its two immediate children) and it displays folder icons for each of those folders, but it does not display the lines or the + sign for expansion and it doesn't seem to be using the correct font. This may be some sort of relative pathing issue that is resolved differently when the page is called this way than it is when the page is called via an iFrame. Any suggestions would be appreciated.