如何根据一些运行时参数隐藏dgrid(gridFrom Html)中的完整列? 让我们说如果参数的值为true我应该能够显示一些列,如果值为false,那么我应该能够隐藏同一列. 使用grid.styleColumn(columnId,css):
让我们说如果参数的值为true我应该能够显示一些列,如果值为false,那么我应该能够隐藏同一列. 使用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;");
