Need to add URLParameter to TreeView

Working with a grid view in ASP.Net Core. Will use it for navigation. The grid view displays fine, I am just having some difficulty returning the node when a user selects it.

I have uploaded a zip file that contains the HTML that I am using with the Essential Javascript Playground to try and get this to work.

[As an aside, is there a way which I can save my code in the playground?]

So this works, kind of, I am able to return the name that the user picked. But how do I add in a URLParameter and then return that instead, or indeed any arbitrary parameter?

Thanks so very much.

Br





Attachment: EssentialStudioforJavaScript_TreeViewDataBindingLocal.html_b1f8437c.zip

1 Reply

SS Sharon Sanchez Selvaraj Syncfusion Team September 2, 2021 02:45 PM UTC

Hi Bryan, 
 
Thanks for contacting Syncfusion support. 
 
We checked with your requirement in TreeView and the attached code snippet. We suspect that you would like to pass the node data selected from the TreeView to the server. We have used the same data from your attached sample in an ASP.NET Core sample and have passed the selected data through an AJAX request to the server. 
 
Please refer to the below code snippet: 
 
  function onSelect(args) {  
         $.ajax({  
            type: "POST",  
            data: { value: args.value }, 
            url: "/Home/Features",  
            success: function (result) {   
                alert(result);  
            }  
        });  
      } 
 
//Controller

[HttpPost]
 
        public ActionResult Features(string value) 
        { 
            string val = value; 
            return Json(val); 
        } 
 
Refer to the sample: 
 
 
If we have misunderstood, please provide additional details on your requirement so that we can assist you promptly. 
 
Regards, 
Sharon Sanchez S.

Loader.
Up arrow icon