Runtime error when double click node

11 posts, 1 answers
  1. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 30 Mar 2008 Link to this post

    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

  2. Answer
    Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 31 Mar 2008 Link to this post

    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
  3. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 31 Mar 2008 Link to this post

    Thanx for reply Nick,

    I am looking forward for your fix,

    Regards,
    Elton
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Jul 2009 Link to this post

    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.
  5. Michael
    Michael avatar
    8 posts
    Member since:
    Sep 2007

    Posted 07 Oct 2009 Link to this post

    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
  6. Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 12 Oct 2009 Link to this post

    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.
  7. Michael
    Michael avatar
    8 posts
    Member since:
    Sep 2007

    Posted 12 Oct 2009 Link to this post

    There are no javascript errors.  Nothing happens when I try to expand/collapse node when I have this fix in place.
  8. Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 15 Oct 2009 Link to this post

    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.
  9. Michael
    Michael avatar
    8 posts
    Member since:
    Sep 2007

    Posted 19 Oct 2009 Link to this post

    that worked..

    Thanks,
    Michael
  10. Eric
    Eric avatar
    8 posts
    Member since:
    Aug 2008

    Posted 20 Mar 2011 Link to this post

    Has this been fixed yet? I am using build 2010.3.1317.35 and this appears to still be an issue.
  11. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 21 Mar 2011 Link to this post

    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
Back to Top