JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Table › How can I hide a specific column with CSS only? › Reply To: How can I hide a specific column with CSS only?
February 10, 2021 at 4:53 pm
#101472
fimarapp
Member
This is the full code:
const fields = [
'id: string',
'name: string',
'surname: string'
]
const get_columns = () =>
fields.map(field => {
const f = field.split(':')
return {
visible: f[0] == 'id' ? false : true,
label: $_(f[0]),
dataField: f[0],
dataType: f[1].trim()
}
})
onMount(() => {
// Create table
Smart('#table', class {
get properties() {
return {
keyboardNavigation: true,
filtering: true,
sortMode: 'one',
selection,
paging: true,
freezeHeader: true,
virtualization: true,
dataSource: new Smart.DataAdapter({
dataSource: source, dataFields: fields }),
columns: get_columns()
}
}
})