AllNodes is not returning array with Telerik.Web.UI

0 Answers 48 Views
TreeView
Sachita
Top achievements
Rank 1
Iron
Iron
Iron
Sachita asked on 14 Jan 2022, 03:12 PM | edited on 17 Jan 2022, 03:58 AM

We have migrated to Telerik.Web.UI from Telerik.WebControls ,Telerik Version - 2021.3.914.45,.Net-4.8

Tried with get_allNodes() instead of AllNodes but no luck.

 function getNodes() {
				
				return this.getTree().AllNodes;                          //AllNodes is not returning Array

            }
 return {
                getTree: function() {
                    if (!this.elements["tree"]) { this.elements["tree"] = window[this.element.getAttribute("tree")]; }
                    return this.elements["tree"];
                },
                getHiddenFieldEl: function() {
                    if (!this.elements["hidden"]) { this.elements["hidden"] = $(this.element.getAttribute("hf")); }
                    return this.elements["hidden"];
                },
                toString: function() { return "Simple Tree"; },
                init: function() {
                    this.hasCheckBoxes = (this.element.getAttribute("checkmode") === "true");

                    Test.Controls.attachSubmitEvent(onSubmit, this, true);
                },
validate: function(source, args) {
                    var isValid = false;
                   var allNodes = getNodes.call(this);                                     //allNodes as Undefined
                    for(var i = 0, len = allNodes.length; i < len; i++) { 
					
                        var node = allNodes[i];
                        if(!node.Checked) { continue; }
                        
                        isValid = true;
                        break;
                    }
                    
                    args.IsValid = isValid;
                }

Can anyone please help to resolve this issue? what should be changed in the above code after migration?

 

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Sachita
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or