Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Manolis Samoilis on May 28, 2007 17:44
open dhtmlx forum
refreshItem() Problem in xTree 1.5 pro

Hi,

I have the following code of tree:

var tree=new dhtmlXTreeObject("box_tree","100%","100%",0);
tree.setImagePath("/commonfiles/images/tree/csh_winstyle/");
tree.enableKeyboardNavigation(true);
tree.enableDragAndDrop(true);
tree.attachEvent("onDrag",onDrag);
tree.attachEvent("onDrop",onDrop);
tree.setOnDblClickHandler(onDblClick)
tree.setXMLAutoLoading("get/treeData.asp?xType=Arthra")
tree.loadXML("get/treeData.asp?xType=Arthra&id=0")

and run the tree.refreshItem(0) command on click of a button

Then any time that click any clild of the tree, an javascript error has display in the page: Line 87 : 'span' is null or not an object

This is the debugger output:

{node.span.className="standartTreeRow";if (node.acolor)node.span.style.color=node.acolor;node.i_sel=false;for (var i=0;i<this._selected.length;i++)if (!this._selected[i].i_sel){this._selected.splice(i,1);break;};};};dhtmlXTreeObject.prototype._unselectItems=function(){for (var i=0;i<this._selected.length;i++){var node=this._selected[i];node.span.className="standartTreeRow";if (node.acolor)node.span.style.color=node.acolor;node.i_sel=false;};this._selected=new Array();};dhtmlXTreeObject.prototype.onRowSelect=function(e,htmlObject,mode){e=e||window.event;var obj=this.parentObject;if (htmlObject)obj=htmlObject.parentObject;var that=obj.treeNod;var lastId=that.getSelectedItemId();if ((!e)||(

Thanks,

Manolis Samoilis

 

 

Answer posted on May 28, 2007 18:59
Problem with selection in tree while reloading confirmed and fixed. Fix will be available as part of next version. ( please contact us directly at dhtmlx@scand.com if you need fixed file ASAP )
Also in current version ( 1.5 ) problem can be resolved by next workaround:
    just clear selection before reloading.

       tree.clearSelection();
       tree.refreshItem(0);
Answer posted by Manolis Samoilis on May 28, 2007 20:26
Thank you for the excellent assistance and speed of service!!!
Answer posted by Alexandra (Support) on Dec 11, 2014 02:36

The information connected with dhtml javascript calendar and https file transfer also can help you, so please check it too.