RadTreeView scrolls on expand or collapse

1 posts, 0 answers
  1. Brent
    Brent avatar
    1 posts
    Member since:
    Dec 2014

    Posted 15 Dec 2014 Link to this post

    I am having an issue with the RadTreeView control where it scrolls to the selected node unexpectedly.  See attached code:

    <%@ Page Language="vb" AutoEventWireup="false" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <telerik:RadAjaxLoadingPanel ID="EntityTreeLoading"
                runat="server"
                Transparency="0" BackColor="#CCCCFF" Wrap="False" HorizontalAlign="Center">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadScriptBlock ID="EntityTreeScriptBlock" runat="server">
                <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
                <script type="text/javascript">
                    //<![CDATA[
                    GLMDictionary = function(levels) {
                        var lvl;
                        var _levels = levels; // the number of levels of lookup in the dictionary
                        var _dictionary = [];
                        var that = this;
                        this._isArray = function(obj) {
                            return obj.constructor == Array;
                        };
                        this.clear = function() {
                            _dictionary = [];
                        };
                        this.get_levels = function() {
                            return _levels;
                        };
                        this.get_entry = function() {
                            if (arguments.length < this.get_levels() || arguments.length > that.get_levels()) {
                                throw 'Invalid number of arguments, dictionary requires ' + that.get_levels() + ' keys';
                            }
                            var associativeArray = _dictionary;
                            for (lvl = 0; lvl < arguments.length; lvl++) {
                                if (lvl < this.get_levels()) {
                                    associativeArray = associativeArray[arguments[lvl]];
                                    if (!associativeArray) {
                                        return null;
                                    }
                                }
                            }
                            if (associativeArray === undefined) {
                                return null; // cleanup undefined
                            }
                            return associativeArray;
                        };
                        this.set_entry = function() {
                            if (arguments.length < this.get_levels() + 1 || arguments.length > that.get_levels() + 1) {
                                throw 'Invalid number of arguments, dictionary requires ' + that.get_levels() + ' keys and one value';
                            }
                            var associativeArray = _dictionary; // seed the array
                            for (lvl = 0; lvl < arguments.length; lvl++) {
                                if (lvl < this.get_levels() - 1) {
                                    if (!associativeArray[arguments[lvl]]) {
                                        associativeArray[arguments[lvl]] = [];
                                    }
                                    associativeArray = associativeArray[arguments[lvl]]; // goto the inner arrray
                                }
                            }
                            associativeArray[arguments[that.get_levels() - 1]] = arguments[this.get_levels()]; // set the actual value
                        };
                        return this;
                    };
     
                    var json_nodes = JSON.parse('[{"ID":"1","PK":"1000015","value":"NodeType=Entity:Self,EntityObjectPK =1000015","name":"_test, bag 5,<br />Individual","tooltip":"1, 4, 1000015","cssClass":"SubHeadingClass","image":"/UI/private/images/individual.jpg","Nodes":[{"ID":"0","PK":"Correspondence","value":"","name":"Correspondence","tooltip":"Correspondence","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"7","PK":"28","value":"NodeType=Object:19117782,ObjectID=7,ObjectPK=28,EntityObjectPK=1000015","name":"New Test Corr","tooltip":"7, 10007, 28","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"1097","value":"NodeType=Object:19117783,ObjectID=22,ObjectPK=1097,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 1097","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"26","value":"NodeType=Object:19114378,ObjectID=7,ObjectPK=26,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 26","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"28","value":"NodeType=Object:19114379,ObjectID=22,ObjectPK=28,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 28","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"25","value":"NodeType=Object:19114376,ObjectID=7,ObjectPK=25,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 25","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"27","value":"NodeType=Object:19114377,ObjectID=22,ObjectPK=27,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 27","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"24","value":"NodeType=Object:19114374,ObjectID=7,ObjectPK=24,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 24","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"26","value":"NodeType=Object:19114375,ObjectID=22,ObjectPK=26,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 26","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"23","value":"NodeType=Object:19114372,ObjectID=7,ObjectPK=23,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 23","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"25","value":"NodeType=Object:19114373,ObjectID=22,ObjectPK=25,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 25","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"22","value":"NodeType=Object:19114370,ObjectID=7,ObjectPK=22,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 22","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"24","value":"NodeType=Object:19114371,ObjectID=22,ObjectPK=24,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 24","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"21","value":"NodeType=Object:19114368,ObjectID=7,ObjectPK=21,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 21","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"23","value":"NodeType=Object:19114369,ObjectID=22,ObjectPK=23,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 23","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"20","value":"NodeType=Object:19114366,ObjectID=7,ObjectPK=20,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 20","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"22","value":"NodeType=Object:19114367,ObjectID=22,ObjectPK=22,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 22","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"19","value":"NodeType=Object:19114364,ObjectID=7,ObjectPK=19,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 19","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"21","value":"NodeType=Object:19114365,ObjectID=22,ObjectPK=21,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 21","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"18","value":"NodeType=Object:19114362,ObjectID=7,ObjectPK=18,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 18","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"20","value":"NodeType=Object:19114363,ObjectID=22,ObjectPK=20,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 20","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"17","value":"NodeType=Object:19114360,ObjectID=7,ObjectPK=17,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 17","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"19","value":"NodeType=Object:19114361,ObjectID=22,ObjectPK=19,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 19","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"16","value":"NodeType=Object:19114358,ObjectID=7,ObjectPK=16,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 16","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"18","value":"NodeType=Object:19114359,ObjectID=22,ObjectPK=18,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 18","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"15","value":"NodeType=Object:19114356,ObjectID=7,ObjectPK=15,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 15","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"17","value":"NodeType=Object:19114357,ObjectID=22,ObjectPK=17,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 17","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"14","value":"NodeType=Object:19114354,ObjectID=7,ObjectPK=14,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 14","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"16","value":"NodeType=Object:19114355,ObjectID=22,ObjectPK=16,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 16","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"13","value":"NodeType=Object:19114352,ObjectID=7,ObjectPK=13,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 13","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"15","value":"NodeType=Object:19114353,ObjectID=22,ObjectPK=15,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 15","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"12","value":"NodeType=Object:19114350,ObjectID=7,ObjectPK=12,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 12","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"14","value":"NodeType=Object:19114351,ObjectID=22,ObjectPK=14,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 14","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"11","value":"NodeType=Object:19114348,ObjectID=7,ObjectPK=11,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 11","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"13","value":"NodeType=Object:19114349,ObjectID=22,ObjectPK=13,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 13","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"10","value":"NodeType=Object:19114346,ObjectID=7,ObjectPK=10,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 10","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"12","value":"NodeType=Object:19114347,ObjectID=22,ObjectPK=12,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 12","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"9","value":"NodeType=Object:19114344,ObjectID=7,ObjectPK=9,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 9","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"11","value":"NodeType=Object:19114345,ObjectID=22,ObjectPK=11,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 11","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"8","value":"NodeType=Object:19114342,ObjectID=7,ObjectPK=8,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 8","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"10","value":"NodeType=Object:19114343,ObjectID=22,ObjectPK=10,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 10","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"7","value":"NodeType=Object:19114340,ObjectID=7,ObjectPK=7,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 7","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"9","value":"NodeType=Object:19114341,ObjectID=22,ObjectPK=9,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 9","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"6","value":"NodeType=Object:19114338,ObjectID=7,ObjectPK=6,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 6","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"8","value":"NodeType=Object:19114339,ObjectID=22,ObjectPK=8,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 8","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"5","value":"NodeType=Object:19114336,ObjectID=7,ObjectPK=5,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 5","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"7","value":"NodeType=Object:19114337,ObjectID=22,ObjectPK=7,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 7","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"4","value":"NodeType=Object:19114334,ObjectID=7,ObjectPK=4,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 4","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"6","value":"NodeType=Object:19114335,ObjectID=22,ObjectPK=6,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 6","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"3","value":"NodeType=Object:19114332,ObjectID=7,ObjectPK=3,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 3","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"5","value":"NodeType=Object:19114333,ObjectID=22,ObjectPK=5,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 5","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]},{"ID":"7","PK":"2","value":"NodeType=Object:19114330,ObjectID=7,ObjectPK=2,EntityObjectPK=1000015","name":"Test Letter","tooltip":"7, 1714, 2","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Correspondence.jpg","Nodes":[{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"4","value":"NodeType=Object:19114331,ObjectID=22,ObjectPK=4,EntityObjectPK=1000015","name":"Correspondence","tooltip":"22, 1591, 4","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]}]}]},{"ID":"0","PK":"Association","value":"","name":"Association","tooltip":"Association","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"11","PK":"19117747","value":"NodeType=Association:4719,ObjectID=11,ObjectPK=19117747,EntityObjectPK=1000015","name":"Owns Business","tooltip":"11, 4719, 19117747","cssClass":"","image":"/UI/Private/Images/img_association_open.gif"}]},{"ID":"0","PK":"Address","value":"","name":"Address","tooltip":"Address","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"17","PK":"1080","value":"NodeType=Object:19117922,ObjectID=17,ObjectPK=1080,EntityObjectPK=1000015","name":"Test Address","tooltip":"17, 1711, 1080","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"3","value":"NodeType=Object:19114444,ObjectID=17,ObjectPK=3,EntityObjectPK=1000015","name":"Physical Address: Current","tooltip":"17, 1716, 3","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"2","value":"NodeType=Object:19114303,ObjectID=17,ObjectPK=2,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 2","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg","Nodes":[{"ID":"0","PK":"Address","value":"","name":"Address","tooltip":"Address","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"17","PK":"50","value":"NodeType=Object:19114682,ObjectID=17,ObjectPK=50,EntityObjectPK=1000015","name":"Mailing Address: Current","tooltip":"17, 1492, 50","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"49","value":"NodeType=Object:19114681,ObjectID=17,ObjectPK=49,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 49","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"48","value":"NodeType=Object:19114680,ObjectID=17,ObjectPK=48,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 48","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"47","value":"NodeType=Object:19114679,ObjectID=17,ObjectPK=47,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 47","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"46","value":"NodeType=Object:19114672,ObjectID=17,ObjectPK=46,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 46","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"45","value":"NodeType=Object:19114671,ObjectID=17,ObjectPK=45,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 45","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"44","value":"NodeType=Object:19114670,ObjectID=17,ObjectPK=44,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 44","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"43","value":"NodeType=Object:19114669,ObjectID=17,ObjectPK=43,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 43","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"41","value":"NodeType=Object:19114667,ObjectID=17,ObjectPK=41,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 41","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"},{"ID":"17","PK":"40","value":"NodeType=Object:19114666,ObjectID=17,ObjectPK=40,EntityObjectPK=1000015","name":"Mailing Address: Previous","tooltip":"17, 1492, 40","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Addresses.jpg"}]}]}]},{"ID":"0","PK":"Invoice","value":"","name":"Invoice","tooltip":"Invoice","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"18","PK":"7","value":"NodeType=Object:19114675,ObjectID=18,ObjectPK=7,EntityObjectPK=1000015","name":"Batch Fee","tooltip":"18, 1720, 7","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Invoice.jpg"},{"ID":"18","PK":"1","value":"NodeType=Object:19114419,ObjectID=18,ObjectPK=1,EntityObjectPK=1000015","name":"Batch Fee","tooltip":"18, 1720, 1","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Invoice.jpg","Nodes":[{"ID":"0","PK":"Payment","value":"","name":"Payment","tooltip":"Payment","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"23","PK":"2","value":"NodeType=Object:19114423,ObjectID=23,ObjectPK=2,EntityObjectPK=1000015","name":"Credit Card","tooltip":"23, 1527, 2","cssClass":"ChildPropertyNode","image":""},{"ID":"23","PK":"2","value":"NodeType=Object:19114422,ObjectID=23,ObjectPK=2,EntityObjectPK=1000015","name":"Credit Card","tooltip":"23, 1527, 2","cssClass":"ChildPropertyNode","image":""},{"ID":"23","PK":"1","value":"NodeType=Object:19114421,ObjectID=23,ObjectPK=1,EntityObjectPK=1000015","name":"Credit Card","tooltip":"23, 1527, 1","cssClass":"ChildPropertyNode","image":""}]}]}]},{"ID":"0","PK":"Document","value":"","name":"Document","tooltip":"Document","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"22","PK":"89","value":"NodeType=Object:19114677,ObjectID=22,ObjectPK=89,EntityObjectPK=1000015","name":"Test Document","tooltip":"22, 1712, 89","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"},{"ID":"22","PK":"87","value":"NodeType=Object:19114674,ObjectID=22,ObjectPK=87,EntityObjectPK=1000015","name":"Test Document","tooltip":"22, 1712, 87","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Document.jpg"}]},{"ID":"0","PK":"Names","value":"","name":"Names","tooltip":"Names","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"19","PK":"1000051","value":"NodeType=Object:19114442,ObjectID=19,ObjectPK=1000051,EntityObjectPK=1000015","name":"Individual Name: Current: _test: bag","tooltip":"19, 5, 1000051","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/Name.jpg"}]},{"ID":"0","PK":"History","value":"","name":"History","tooltip":"History","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"14","PK":"21","value":"NodeType=Object:19114432,ObjectID=14,ObjectPK=21,EntityObjectPK=1000015","name":"Medical School","tooltip":"14, 1708, 21","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"},{"ID":"14","PK":"20","value":"NodeType=Object:19114431,ObjectID=14,ObjectPK=20,EntityObjectPK=1000015","name":"Medical School","tooltip":"14, 1708, 20","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"},{"ID":"14","PK":"19","value":"NodeType=Object:19114430,ObjectID=14,ObjectPK=19,EntityObjectPK=1000015","name":"Medical School","tooltip":"14, 1708, 19","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"},{"ID":"14","PK":"18","value":"NodeType=Object:19114429,ObjectID=14,ObjectPK=18,EntityObjectPK=1000015","name":"Medical School","tooltip":"14, 1708, 18","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"},{"ID":"14","PK":"1","value":"NodeType=Object:19114277,ObjectID=14,ObjectPK=1,EntityObjectPK=1000015","name":"Medical School","tooltip":"14, 1708, 1","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"}]},{"ID":"0","PK":"Test Collection","value":"","name":"Test Collection","tooltip":"Test Collection","cssClass":"ParentPropertyNode","image":"/UI/private/images/Folder.jpg","Nodes":[{"ID":"14","PK":"17","value":"NodeType=Object:19114428,ObjectID=14,ObjectPK=17,EntityObjectPK=1000015","name":"High School","tooltip":"14, 1709, 17","cssClass":"ChildPropertyNode","image":"/UI/Private/Images/History.jpg"}]}]}]');
     
                    var _savedSubtrees = null;
                    this.savedSubtrees = new GLMDictionary(2);
                    this.get_savedSubtrees = function() { return _savedSubtrees; };
                    this.set_savedSubtrees = function(subtree) {
                        _savedSubtrees = subtree;
                    };
     
                    var etc;
                    var _entitytreecontrol = { // static methods and attributes
                        // This data are pushed to the client from server on load (indicating the initial nodes to select)
                        _control: null,
                        _initialize: function() { },
                        _entityTreeCollapseAll: function(button, args) {
                            handleEntityTreeCollapseAll(button, args);
                        },
                        _entityTreeExpandAll: function(button, args) {
                            handleEntityTreeExpandAll(button, args);
                        },
                        _OnETCClientNodeClicking: function(sender, args) {
                        },
                        _OnETCClientNodeExpanding: function(sender, args) {
                        },
                        _keyRegister: [],
                        _loadingID: "<%= EntityTreeLoading.ClientID %>",
                        _treeName: "<%= entityTreeView.ClientID %>",
                        _updatePanel: "<%= EntityTreeUpdatePanel.ClientID %>",
                        _lastClick: null
                    };
     
                    function get_tree() {
                        return $find(_entitytreecontrol._treeName);
                    }
     
                    $(document).ready(function() {
                        appendNodesToTree(json_nodes);
                    });
     
                    function appendNodesToTree(json_msg) {
                        this.savedSubtrees.clear();   // clears the dictionary of sub-trees
     
                        this.addChildrenNodes(json_msg, this.get_tree().get_nodes(), [], this.get_tree());
     
                        this.get_tree().get_nodes()._array[0].select();
                    }
     
                    function findExistingNode(nodesArray, jsonNode) {
                        var i;
                        if (nodesArray) {
                            for (i = 0; i < nodesArray.length; i++) {
                                var existingNode = nodesArray[i];
                                var attrib = existingNode.get_attributes();
                                var id = attrib.getAttribute('objID');
                                var pk = attrib.getAttribute('objPK');
                                if (id == jsonNode.ID && pk == jsonNode.PK) {
                                    return existingNode;
                                }
                            }
                        }
                        return null;
                    }
     
                    function findNodeDeep(node, jsonNode) {
                        var i;
                        if (node) {
                            var nodes = node.get_nodes();
                            for (i = 0; i < nodes.get_count() ; i++) {
                                var newNode = nodes.getNode(i);
                                var attrib = newNode.get_attributes();
                                var id = attrib.getAttribute('objID');
                                var pk = attrib.getAttribute('objPK');
                                if (id == jsonNode.ID && pk == jsonNode.PK) {
                                    return newNode;
                                }
                                else {
                                    var deepNode = this.findNodeDeep(newNode, jsonNode);
                                    if (deepNode) {
                                        return deepNode;
                                    }
                                }
                            }
                        }
                        return null;
                    }
     
                    function addChildrenNodes(json_nodes, appendPoint, oldNodeCollection, parentNode) {
     
                        var i;
                        var ei;
                        if (json_nodes) {
                            var existingNode;
                            for (i = 0; i < json_nodes.length; i++) {
                                existingNode = oldNodeCollection !== null ? this.findExistingNode(oldNodeCollection, json_nodes[i]) : null;
                                if (existingNode === null) {
                                    existingNode = this.savedSubtrees.get_entry(json_nodes[i].ID, json_nodes[i].PK);
                                }
                                else if (existingNode.get_nodes().get_count() > 0) {
                                    for (ei = 0; ei < existingNode.get_nodes().get_count() ; ei++) {
                                        var oldChildNode = existingNode.get_nodes().getNode(ei);
                                        var oldattrib = oldChildNode.get_attributes();
                                        var oldid = oldattrib.getAttribute('objID');
                                        var oldpk = oldattrib.getAttribute('objPK');
                                        this.savedSubtrees.set_entry(oldid, oldpk, existingNode);
                                    }
                                }
                                var child = new Telerik.Web.UI.RadTreeNode();
                                child.set_text(json_nodes[i].name);
                                child.set_value(json_nodes[i]);
                                child.set_toolTip(json_nodes[i].tooltip);
                                //child.set_imageUrl(json_nodes[i].image);
                                child.set_cssClass(json_nodes[i].cssClass);
     
                                var attrib = child.get_attributes();
                                attrib.setAttribute('objID', json_nodes[i].ID);
                                attrib.setAttribute('objPK', json_nodes[i].PK);
     
                                if (existingNode !== null) {
                                    child.set_selected(existingNode.get_selected());
                                    child.set_expanded(existingNode.get_expanded());
                                    child.set_enabled(existingNode.get_enabled());
                                    if (child.get_expanded() && (!json_nodes[i].Nodes || json_nodes[i].Nodes.length === 0)) {
                                        glsuite.get_pageController().schedulePRB(this.processMenuRestoreViewRequest, this, 0, [child], null, null);
                                    }
                                }
     
                                this.addChildrenNodes(json_nodes[i].Nodes, child.get_nodes(), (existingNode !== null ? existingNode.get_nodes().toArray() : null), child);
     
                                appendPoint.add(child);
                            }
                        }
                    }
     
                    function handleEntityTreeExpandAll(button, args) {
                        var i;
     
                        var treeView = this.get_tree();
                        var nodes = treeView.get_allNodes();
                        for (i = 0; i < nodes.length; i++) {
                            if (nodes[i].get_nodes() !== null) {
                                nodes[i].expand();
                            }
                        }
                    }
     
                    function handleEntityTreeCollapseAll(button, args) {
                        var i;
     
                        var treeView = this.get_tree();
                        var nodes = treeView.get_allNodes();
                        for (i = 0; i < nodes.length; i++) {
                            if (nodes[i].get_nodes() !== null) {
                                nodes[i].collapse();
                            }
                        }
                    }
                    //]]>
                </script>
            </telerik:RadScriptBlock>
            <table width="100%" style="overflow: scroll;">
                <tr style="overflow: scroll;">
                    <td style="width: 15%; vertical-align: top;">
                        <table align="left" style="width: 100%;">
                            <tr align="center" style="width: 100px;">
                                <td style="vertical-align: top; text-align: left;">
                                    <div>
                                        <br />
                                        <div>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <telerik:RadButton ID="showAllButton" runat="server"
                                                            EnableEmbeddedBaseStylesheet="false" AutoPostBack="false"
                                                            Text="Show All ▶" OnClientClicked="_entitytreecontrol._entityTreeExpandAll">
                                                        </telerik:RadButton>
                                                    </td>
                                                    <td>
                                                        <telerik:RadButton ID="hideAllButton"
                                                            runat="server"
                                                            AutoPostBack="false" Text="Hide All ▶" OnClientClicked="_entitytreecontrol._entityTreeCollapseAll"
                                                            CssClass="HideAllButton">
                                                        </telerik:RadButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <br />
                                        <telerik:RadAjaxPanel ID="EntityTreeUpdatePanel" runat="server">
                                            <telerik:RadTreeView ID="entityTreeView" runat="server"
                                                EnableAjaxSkinRendering="true" Height="500px" Width="300px"
                                                OnClientNodeClicking="_entitytreecontrol._OnETCClientNodeClicking"
                                                OnClientNodeExpanding="_entitytreecontrol._OnETCClientNodeExpanding"
                                                EnableEmbeddedScripts="true" EnableTheming="true" EnableViewState="false"
                                                ShowLineImages="false" TabIndex="1"
                                                SingleExpandPath="false"
                                                CausesValidation="false" Style="white-space: normal;"
                                                RegisterWithScriptManager="True" EnableAriaSupport="True">
                                            </telerik:RadTreeView>
                                        </telerik:RadAjaxPanel>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </form>
    </body>
    </html>

    Replication steps:
    1) Expand enough nodes to have a scrollbar.
    2) Select a node.
    3) Scroll until the selected node is not in view.
    4) Expand or Collapse a node.
    5) The screen will scroll until the selected node is in view.  <- bad.

    Please help me fix this.
Back to Top