title: How to define an object property based on a if/else statement?
body: <p>I'm trying to configure the state of a datatable button based on a if/else statement. </p>
  
  <p>The datatable button object:</p>
  
  <pre><code>    buttons: [
          {
              text: "button text",
              action: function (e, dt, node, config) {
                  button_action();
              },
              enabled: function () {
                  if (column_exists) {
                      this.enabled = true
                  } else {
                      this.enabled = false
                  }
              }
        }
      ]
  </code></pre>
  
  <p>With this code, my button is always enabled. How can I set the <code>enabled</code> parameter correctly based on an if/else statement ?</p>