Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Commit 002f701

Browse files
Updated README.md
1 parent a500405 commit 002f701

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ new Vue({
7878
|-------------|-----------------------------------------------------------------------------------------------------|
7979
| change | Handle show limit changed. Gets object with new show limit and current page `{perpage: 10, page: 2}`|
8080
| searching | Handles search input. Gets string as parameter |
81+
| column-sort | Only if `order` is defined in column array. Return the current column sorted with metadata ([Sort Column](#sort-column))
8182

8283
### Columns
8384
Each column object needs `name` and `key` attributes.
@@ -122,6 +123,31 @@ To get the user role we would need to define in our columns array:
122123
}
123124
```
124125

126+
### Sort column
127+
**[New]** You only need a `order` property in column defined for use this feature.
128+
```javascript
129+
{
130+
...,
131+
columns: [
132+
{
133+
name: 'Name',
134+
key: 'name',
135+
order: true
136+
}
137+
]
138+
}
139+
```
140+
141+
This feature emit a event `column-sort` with this data object
142+
```javascript
143+
{
144+
sort: {
145+
key: 'name',
146+
order: false
147+
},
148+
type: 'DESC'
149+
}
150+
```
125151

126152
### Render column
127153
This callback will modify the data for various operations. Such as applying a specific format or an arithmetic operation to the column value and return it.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /