You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/table-builder/1.2/tb-column.md
+44Lines changed: 44 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,50 @@ It is a component of the column of dynamic tables. It is available for use only
66
66
|**name (*)**|`String`|`undefined`| Name of key in the data object |
67
67
|**label**|`String`|`undefined`| Column caption in the header |
68
68
|**media**|`String`|`undefined`| Key of media expressions |
69
+
|**sort**|`String`|`undefined`| Sort params for column. If empty string is given, default params will be used |
70
+
71
+
72
+
### Sorting values in column
73
+
74
+
By default, all the columns are not sortable. To create a sortable column, simply pass the `sort` prop to the component
75
+
76
+
```html
77
+
<tb-columnname="my_column"sort></tb-column>
78
+
```
79
+
80
+
Thus, default configuration of sortable columns will be used. To overwrite it globally, pass your own config to `AWES_CONFIG.tableBuilder`. The default config is:
81
+
82
+
```javascript
83
+
{
84
+
// ... some other config params
85
+
sort: {
86
+
param:'orderBy', // <-- GET-param name in browser query string
87
+
ascTemplate:'%s', // <-- template, where '%s' is replaced with column name
88
+
descTemplate:'%s_desc'
89
+
}
90
+
}
91
+
```
92
+
93
+
You may overwrite template values for each column, by passing custom values to sort param. Separate them with pipe sign `|`, first is for ascending order, second is for descending.
94
+
95
+
> Note that param name could not be configured for each column, it is configured globally
96
+
97
+
```html
98
+
<!-- custom param values. Query string will look like: -->
0 commit comments