Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alfikridotname/0defeee449d57dd39878827b34563d81 to your computer and use it in GitHub Desktop.
Save alfikridotname/0defeee449d57dd39878827b34563d81 to your computer and use it in GitHub Desktop.
Hide Column Datatable With Condition
// Get Column Action
let apiData = this.api().columns(11).data();
let apiDataLength = apiData[ 0 ];
if (apiDataLength.length > 0) {
apiData.each(function (value, index) {
if (value[ index ] != "") {
requestorderDatatable.column(11).visible(true);
return false;
} else {
requestorderDatatable.column(11).visible(false);
}
});
} else {
requestorderDatatable.column(11).visible(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment