Edit nodes when bound to remote datasource

Is there a way to rename nodes when a treeview is bound to a remote data source? When I rename a node and focus out the name goes back to the original.

3 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team November 19, 2020 11:24 AM UTC

Hi Hosney,  
 
Greetings from Syncfusion support. 
 
We have checked your requirement with TreeView component. In TreeView, we have provided a CRUD operations support for TreeView component when using DataManager component. So, if you are using remote data, you need to bind the corresponding server side method for editing of TreeView node. 
 
When you perform any operations (Edit/delete/add) to TreeView node, it triggers the corresponding controller method. You can save the data on sever side. 
 
Please, refer the below code for update data ( rename TreeView node) method in server side. 
 
  [HttpPost] 
        public ActionResult Update([FromBody]CRUDModel<TreeDetailsvalue) 
        { 
            var ord = value.value; 
            TreeDetails val = TreeDetails.GetAllRecords().Where(or => or.orderID == ord.orderID).FirstOrDefault(); 
            val.orderID = ord.orderID; 
            val.employeeID = ord.employeeID; 
            val.customerID = ord.customerID; 
            return Json(value.value); 
        } 
 
We have faced similar query with TreeView component. In the below forum, we have provided a TreeView sample using DataManager adaptor. Please, refer the sample in the below forum. 
 
 
Please, refer the below links for remote data sample for TreeView component. 
 
 
Please, refer the below links to know more about the Adaptors. 
 
 
If we misunderstood your requirement, could you please share the below details. 
 
1.     Share the defining code snippet for TreeView component. 
2.     Which adaptors you have used to fetch the datasource. 
3.     Share the code snippet for rename node. 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer

HO Hosney November 24, 2020 03:17 AM UTC

Thanks!

I made use of the insertUrl, updateUrl, removeUrl as I was using the WebMethodAdaptor.


SP Sowmiya Padmanaban Syncfusion Team November 24, 2020 04:43 AM UTC

Hi Hosney,  
  
We are happy to hear that your problem has been resolved. Please contact us, if you need any help from us. 
  
Regards,  
Sowmiya.P 


Loader.
Up arrow icon