Show/Hide Handsontable columns based on a value

If the information comes from the database you just can put it in a separate function and call it after you fetch the data.

function checkIfShown(){
    if (hide.checked) {
      hot.updateSettings({
        hiddenColumns: {
          columns: [2, 3],
          indicators: true
        }
      })
    } else {
      hot.updateSettings({
        hiddenColumns: {
          columns: [],
          indicators: true
        }
      })
    }
  }