How to hide complete column in dgrid (gridFromHtml) based on some run time parameter? Lets say if the value of parameter is true I should be able to display some column and if the value is false then I should be able to hide that same column.
Use grid.styleColumn(columnId, css)
:
var grid = new Grid({
store: store,
columns: [
{ id: "artist", label: "Artist", field: "Artist"},
{ id: "name", label: "Song", field: "Name"},
{ id: "gerne", label: "Genre", field: "Genre"}
]
}, "grid-placeholder");
// to hide column with id="name"
grid.styleColumn("name", "display: none;");
// to show it
grid.styleColumn("name", "display: table-cell;");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With