We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how do i invoke component methods in reactjs?

Thread ID:

Created:

Updated:

Platform:

Replies:

128901 Feb 15,2017 12:41 AM UTC Feb 15,2017 08:59 AM UTC ReactJS 1
loading
Tags: TreeView
Christopher Hui
Asked On February 15, 2017 12:41 AM UTC

For example, how do I use refresh for the ejTreeView?

https://help.syncfusion.com/api/js/ejtreeview#methods:refresh

How would I do this with a ReactJS component?

Balamurugan P [Syncfusion]
Replied On February 15, 2017 08:59 AM UTC

Hi Christopher, 
Thanks for using Syncfusion Products.  

In ReactJS, you can call the “refresh” method of TreeView as specified in below code block. 

Code block: 
var DefaultTree = React.createClass({ 
    onRefresh: function (e) { 
             //$("#treeview").ejTreeView("refresh"); 
              var treeObj = $('#treeview').data("ejTreeView"); 
              treeObj.refresh(); 
    }, 
       onRemove: function(e){ 
              var treeObj = $('#treeview').data("ejTreeView"); 
              treeObj.removeAll(); 
       }, 
    render: function () { 
        return (    
        <div id="treeview-default">   
           <EJ.Button id="btnRefresh" size="medium" type="button" height={30} width={150} text="Refresh Tree" click={this.onRefresh}> 
           </EJ.Button>  
           <EJ.Button id="btnRemove" size="medium" type="button" height={30} width={150} text="Remove Tree" click={this.onRemove}> 
           </EJ.Button>  
           <EJ.TreeView id="treeview" fields={fields}> 
           </EJ.TreeView> 
        </div> 
        ); 
    } 
});   
 
ReactDOM.render(<DefaultTree />, 
       document.getElementById('treeview-default') 
); 


We have prepared a sample based on this and you can find the sample under the following location: 


Currently we have provided getting started details in our RectJS document.  Also, we have planned to update the document with further details in our upcoming release.  


Please let us know if you require any further assistance. 
 
Regards, 
Balamurugan P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;