title: How to call function in ReactJS in a callback within the same component?
body: <p>I have a function within the component and at the same time I am using <a href="https://datatables.net/" rel="nofollow noreferrer">DataTables</a> button to trigger display a modal. Here's the snippet:</p>
  
  <pre><code>constructor(props) {
        super(props);
        this.state = {
            error: null,
            isLoaded: false,
            table_type: 'default',
            date_time : null,
            data: [],
            header : null
        };
        this.toogleBtnTbl = this.props.toogleBtnTbl.bind(this);
        this.showModal = this.props.showModal.bind(this);
      }
  </code></pre>
  
  <p>I cant call the function <code>this.showModal</code> inside the button of Datatables because <code>this</code> refers to the Datatables in this case. My question is how to call <code>this.showModal</code> inside the <code>action</code> property?</p>
  
  <pre><code>buttons: [
                  {
                      text: 'View in Graph',
                      action: function ( e, dt, node, config ) {  
                          this.showModal();//not working undefined
                      }
                  },
  </code></pre>