Created
July 14, 2023 03:01
-
-
Save alfikridotname/0defeee449d57dd39878827b34563d81 to your computer and use it in GitHub Desktop.
Hide Column Datatable With Condition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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