I handle the client side double click event to move a node from one tree to another.
my code :
treeSrc.trackChanges();
treeDst.trackChanges();
treeSrc.get_nodes().remove(node);
treeDst.get_nodes().add(node);
treeSrc.commitChanges();
treeDst.commitChanges();
...
When I double click some tree node it will be actually moved. However, I also got a runtime error: "'null' is null or not an object"
...
if
(this.get_contextMenuIDs().length>0){
Telerik.Web.UI.RadContextMenu.hideAll();
}
},_expandOnHover:function(e){
if(Telerik.Web.UI.RadTreeView._draggingTreeView){
var _53=this._extractNodeFromDomElement(e.eventMapTarget);
this._hoveredNode=_53;
window.setTimeout(function(){
if(_53==_53._getControl()._hoveredNode){
_53.set_expanded(true);
}
},1000);
}
return true;
},_toggle:function(e){
var _55=this._extractNodeFromDomElement(e.eventMapTarget);
if(!_55.get_isEnabled()){ //This line causes problem
return;
}
this._hideContextMenus();
e.stopPropagation();
var _56=_55.get_expanded();
if(_56==false){
if(this.raise_nodeExpanding(_55)){
return;
}
...
any idea on this?
Cheers,
Elton
10 Answers, 1 is accepted
Thanks for writing to us and your report.
This seems to be a glitch in the treeview control. After the node has been removed, the treeview tries to toggle it and hence the problem appears. Unfortunately, there is no way to cancel the toggle action at this moment. I would suggest that you use the OnClientNodeClicking event instead the OnClientDoubleClick.
I logged this issue in our Bug Tracking system so that our developers can solve the problem with the official Q1 release due in April.
Your Telerik points have been updated for your report.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I am looking forward for your fix,
Regards,
Elton
Just to let you know that the problem is not yet fixed, but will be in the next service pack. As a workaround please add the following javascript right after the treeview's declaration:
<script type="text/javascript"> |
Telerik.Web.UI.RadTreeView.prototype._toggle = function (e) { |
var node = this._extractNodeFromDomElement(e.eventMapTarget); |
if (node) this._toggleNode(e, node); |
} |
</script> |
Kind regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks,
Michael
The workaround is very simple and shouldn't be causing any problems. Can you please check to see if there are other Javascript errors on the page?
All the best,
Dimitar Milushev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am sorry for the confusion - the previously listed workaround is for a later version. Here is the correct one for 2007.3 1425:
<script type="text/javascript">
Telerik.Web.UI.RadTreeView.prototype._originalToggle = Telerik.Web.UI.RadTreeView.prototype._toggle;
Telerik.Web.UI.RadTreeView.prototype._toggle = function (e) {
var node = this._extractNodeFromDomElement(e.eventMapTarget);
if (node) this._originalToggle(e, node);
}
</script>
Best wishes,
Dimitar Milushev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks,
Michael
I may confirm that the issue still exists. The workaround should work however.
Does it work for you?
Greetings,
Helen
the Telerik team