3
0
Fork 0

fix: hide columns when applicable, for simple grid table element

This commit is contained in:
Lance Edgar 2025-02-18 20:20:59 -06:00
parent 9435baebef
commit 81fa500fb0

View file

@ -2,18 +2,20 @@
<${b}-table :data="gridContext['${grid.key}'].data">
% for column in grid.get_vue_columns():
<${b}-table-column field="${column['field']}"
label="${column['label']}"
v-slot="props"
:sortable="${json.dumps(column.get('sortable', False))|n}"
cell-class="c_${column['field']}">
% if grid.is_linked(column['field']):
<a :href="props.row._action_url_view"
v-html="props.row.${column['field']}" />
% else:
<span v-html="props.row.${column['field']}"></span>
% endif
</${b}-table-column>
% if not column['hidden']:
<${b}-table-column field="${column['field']}"
label="${column['label']}"
v-slot="props"
:sortable="${json.dumps(column.get('sortable', False))|n}"
cell-class="c_${column['field']}">
% if grid.is_linked(column['field']):
<a :href="props.row._action_url_view"
v-html="props.row.${column['field']}" />
% else:
<span v-html="props.row.${column['field']}"></span>
% endif
</${b}-table-column>
% endif
% endfor
% if grid.actions: