1
- < th:block th:fragment ="column-table(list, field, name, label, align, sortable, datetimeFormat, class, td_attrs) " vu:alias ="column " vu:selector ="${renderTableAsGrid == null || !renderTableAsGrid } "
2
- th:assert ="${(field != null) or (name != null and label != null)} "
3
- th:with ="columnName=${name != null ? name : field}, columnLabel=${label != null ? label : model.util.label(list + '.' + field)}, columnAlign=${model.util.smartTypeAlign(list, field, align)}, columnClass=${model.util.smartTypeCss(list, field, class, 'col_'+name)}, columnSortable=${sortable != null ? sortable : (field != null) } ">
4
- < th:block th:with ="objectKey=${model.vContext['componentStates']['__${componentId}__'].addObjectToList('columns', {'name': columnName, 'field': field, 'label': columnLabel, 'align': columnAlign, 'sortable': (modifiableTable!=null?false:columnSortable), 'classes':(class?:columnClass), 'headerClasses':(class?:columnClass) })},
1
+ < th:block th:fragment ="column-table(list, field, name, label, align, sortable, sortField, datetimeFormat, class, td_attrs) "
2
+ vu:alias ="column "
3
+ vu:selector ="${renderTableAsGrid == null || !renderTableAsGrid } "
4
+ th:assert ="${(field != null) or (name != null and label != null)} "
5
+ th:with ="columnName=${name != null ? name : field},
6
+ columnLabel=${label != null ? label : model.util.label(list + '.' + field)},
7
+ columnAlign=${model.util.smartTypeAlign(list, field, align)},
8
+ columnClass=${model.util.smartTypeCss(list, field, class, 'col_'+name)},
9
+ columnSortable=${sortable != null ? sortable : (field != null) },
10
+ mySortField=${sortField?:field},
11
+ myDisplayField=${model.util.resolveDisplayField(list, field)},
12
+ mySuffix=${model.util.smartTypeUnit(list, field, null)} ">
13
+ < th:block th:with ="objectKey=${model.vContext['componentStates']['__${componentId}__'].addObjectToList('columns', {'name': columnName, 'field': mySortField, 'label': columnLabel, 'align': columnAlign, 'sortable': (modifiableTable!=null?false:columnSortable), 'classes':(class?:columnClass), 'headerClasses':(class?:columnClass) })},
5
14
myDatetimeFormat=${datetimeFormat?:(field !=null ? model.util.getUiDatetimeFormat(list + '.' + field) : null)} ">
6
15
< th:block th:if ="${myDatetimeFormat != null} " th:attr ="datetimeFormatKey=${objectKey.put('datetimeFormat', myDatetimeFormat)} " th:remove ="all "> </ th:block >
7
16
</ th:block >
8
- < vu:include-data th:if ="${field != null} " object ="${list} " field ="${field} "/>
17
+ < vu:include-data th:if ="${myDisplayField != null} " object ="${list} " field ="${myDisplayField} "/>
18
+ < vu:include-data th:if ="${mySortField != null && mySortField != myDisplayField} " object ="${list} " field ="${mySortField} "/>
9
19
< q-td th:key ="${columnName} " :props ="props " th:with ="label=null " th:attr ="__${td_attrs}__ " >
10
- < vu:content > < th:block th:if ="${field != null} "> {{ props.row.[[${field }]] }}</ th:block > </ vu:content > <!--/* Default content */-->
20
+ < vu:content > < th:block th:if ="${field != null} "> {{ props.row.[[${myDisplayField }]] }}</ th:block > < template th:if =" ${mySuffix != null} " th:v-if =" |props.row['${myDisplayField}'] != null && props.row['${myDisplayField}'] != ''| " > < span vu:text =" ${mySuffix} " > </ span > </ template > </ vu:content > <!--/* Default content */-->
11
21
</ q-td >
12
22
</ th:block >
13
23
14
- < th:block th:fragment ="column-grid(list, field, name, label, align, sortable, datetimeFormat, class, td_attrs) " vu:alias ="column " vu:selector ="${renderTableAsGrid?:false} "
15
- th:assert ="${(field != null) or (name != null and label != null)} "
16
- th:with ="columnName=${field != null ? field : name }, columnLabel=${label != null ? label : model.util.label('__${list + '.' + field}__')} " >
17
- < vu:include-data th:if ="${field != null} " object ="${list} " field ="${field} "/>
24
+ < th:block th:fragment ="column-grid(list, field, name, label, align, sortable, sortField, datetimeFormat, class, td_attrs) "
25
+ vu:alias ="column "
26
+ vu:selector ="${renderTableAsGrid?:false} "
27
+ th:assert ="${(field != null) or (name != null and label != null)} "
28
+ th:with ="columnName=${field != null ? field : name },
29
+ columnLabel=${label != null ? label : model.util.label('__${list + '.' + field}__')},
30
+ myDisplayField=${model.util.resolveDisplayField(list, field)},
31
+ mySuffix=${model.util.smartTypeUnit(list, field, null)} " >
32
+ < vu:include-data th:if ="${myDisplayField != null} " object ="${list} " field ="${myDisplayField} "/>
18
33
< div class ="q-table__grid-item-row " th:attr ="__${td_attrs}__ " >
19
34
< div class ="q-table__grid-item-title " vu:text ="${columnLabel} "> </ div >
20
35
< div class ="q-table__grid-item-value " th:with ="label=null ">
21
- < vu:content > < th:block th:if ="${field != null} "> {{ props.row.[[${field }]] }}</ th:block > </ vu:content >
36
+ < vu:content > < th:block th:if ="${field != null} "> {{ props.row.[[${myDisplayField }]] }}</ th:block > < template th:if =" ${mySuffix != null} " th:v-if =" |props.row['${myDisplayField}'] != null && props.row['${myDisplayField}'] != ''| " > < span vu:text =" ${mySuffix} " > </ span > </ template > </ vu:content >
22
37
</ div >
23
38
</ div >
24
39
</ th:block >
0 commit comments