This is a migrated thread and some comments may be shown as answers.

Runtime error when double click node

10 Answers 128 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Elton
Top achievements
Rank 1
Elton asked on 30 Mar 2008, 06:15 AM
Hi,
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

Sort by
0
Accepted
Nikolay
Telerik team
answered on 31 Mar 2008, 10:37 AM
Hi Elton,

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
0
Elton
Top achievements
Rank 1
answered on 31 Mar 2008, 10:20 PM
Thanx for reply Nick,

I am looking forward for your fix,

Regards,
Elton
0
Veselin Vasilev
Telerik team
answered on 13 Jul 2009, 11:52 AM
Hi guys,

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.
0
Michael
Top achievements
Rank 1
answered on 07 Oct 2009, 03:34 PM
I am using this version of the Telerik.Web.UI control and this work around is causing another issue.  I put this code in place and it did correct my issue with the js error on double click but now I cannot expand/collapse any of the nodes.  If I use OnClientNodeClicking there is no need for the patch but the business rules require I use a double click event.  Any ideas?

Thanks,

Michael
0
Dimitar Milushev
Telerik team
answered on 12 Oct 2009, 04:33 PM
Hi 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.
0
Michael
Top achievements
Rank 1
answered on 12 Oct 2009, 04:36 PM
There are no javascript errors.  Nothing happens when I try to expand/collapse node when I have this fix in place.
0
Dimitar Milushev
Telerik team
answered on 15 Oct 2009, 03:17 PM
Hi Michael,

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.
0
Michael
Top achievements
Rank 1
answered on 19 Oct 2009, 01:23 PM
that worked..

Thanks,
Michael
0
Eric
Top achievements
Rank 2
answered on 20 Mar 2011, 06:42 PM
Has this been fixed yet? I am using build 2010.3.1317.35 and this appears to still be an issue.
0
Helen
Telerik team
answered on 21 Mar 2011, 05:45 PM
Hi Eric,

I may confirm that the issue still exists. The workaround should work however.
Does it work for you?

Greetings,
Helen
the Telerik team
Tags
TreeView
Asked by
Elton
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Elton
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Michael
Top achievements
Rank 1
Dimitar Milushev
Telerik team
Eric
Top achievements
Rank 2
Helen
Telerik team
Share this question
or