Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 30cb3a8

Browse files
add ability to change the sort column
1 parent db667d2 commit 30cb3a8

File tree

6 files changed

+6
-5
lines changed

6 files changed

+6
-5
lines changed

dist/min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/en/details/props-columns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ These are the properties of `columns[i]`:
99
| field | Field name of the row | String | - | - | N |
1010
| explain | Explanation of the field (tooltip) | String | - | - | N |
1111
| sortable | Is sortable | Boolean | true / false | false | N |
12+
| sortField | Field to use for sorting if different than field. | String | - | - | N |
1213
| visible | Is visible | Boolean / String (if the type is String, the visibility is not allowed to toggle) | true / false / 'true' / 'false' | true | N |
1314
| fixed | Is fixed | Boolean / String | true / false / 'left' / 'right' | - | N |
1415
| group | Group name | String | - | - | N |

examples/dist/client.914ee790.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/client.e34add27.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
<script src="//unpkg.com/jquery@2.1.4/dist/jquery.min.js"></script>
1414
<script src="//unpkg.com/bootstrap@3.3.5/dist/js/bootstrap.min.js"></script>
15-
<script type="text/javascript" src="client.e34add27.js"></script></body>
15+
<script type="text/javascript" src="client.914ee790.js"></script></body>
1616
</html>

src/Table/TableHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</template>
2222

2323
<i v-if="col.explain" class="fa fa-info-circle" style="cursor: help" :title="col.explain"></i>
24-
<head-sort v-if="col.sortable" :field="col.field" :query="query" />
24+
<head-sort v-if="col.sortable" :field="col.sortField || col.field" :query="query" />
2525
</th>
2626
</transition-group>
2727
</thead>
@@ -35,6 +35,6 @@ import shouldRenderSelection from '../_mixins/shouldRenderSelection'
3535
export default {
3636
name: 'TableHeader',
3737
components: { HeadSort, MultiSelect },
38-
mixins: [props, shouldRenderSelection]
38+
mixins: [props, shouldRenderSelection],
3939
}
4040
</script>

0 commit comments

Comments
 (0)