-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathcolumnsortable.php
executable file
·121 lines (100 loc) · 3.31 KB
/
columnsortable.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
return [
/*
spec columns
*/
'columns' => [
'alpha' => [
'rows' => ['description', 'email', 'name', 'slug'],
'class' => 'fa fa-sort-alpha',
],
'amount' => [
'rows' => ['amount', 'price'],
'class' => 'fa fa-sort-amount',
],
'numeric' => [
'rows' => ['created_at', 'updated_at', 'level', 'id', 'phone_number'],
'class' => 'fa fa-sort-numeric',
],
],
/*
whether icons should be enabled
*/
'enable_icons' => true,
/*
defines icon set to use when sorted data is none above (alpha nor amount nor numeric)
*/
'default_icon_set' => 'fa fa-sort',
/*
icon that shows when generating sortable link while column is not sorted
*/
'sortable_icon' => 'fa fa-sort',
/*
generated icon is clickable non-clickable (default)
*/
'clickable_icon' => false,
/*
icon and text separator (any string)
in case of 'clickable_icon' => true; separator creates possibility to style icon and anchor-text properly
*/
'icon_text_separator' => ' ',
/*
suffix class that is appended when ascending direction is applied
*/
'asc_suffix' => '-asc',
/*
suffix class that is appended when descending direction is applied
*/
'desc_suffix' => '-desc',
/*
default anchor class, if value is null none is added
*/
'anchor_class' => null,
/*
default active anchor class, if value is null none is added
*/
'active_anchor_class' => null,
/*
default sort direction anchor class, if value is null none is added
*/
'direction_anchor_class_prefix' => null,
/*
relation - column separator ex: detail.phone_number means relation "detail" and column "phone_number"
*/
'uri_relation_column_separator' => '.',
/*
formatting function applied to name of column, use null to turn formatting off
*/
'formatting_function' => 'ucfirst',
/*
apply formatting function to custom titles as well as column names
*/
'format_custom_titles' => true,
/*
inject title parameter in query strings, use null to turn injection off
example: 'inject_title' => 't' will result in ..user/?t="formatted title of sorted column"
*/
'inject_title_as' => null,
/*
allow request modification, when default sorting is set but is not in URI (first load)
*/
'allow_request_modification' => true,
/*
default direction for: $user->sortable('id') usage
*/
'default_direction' => 'asc',
/*
default direction for non-sorted columns
*/
'default_direction_unsorted' => 'asc',
/*
use the first defined sortable column (Model::$sortable) as default
also applies if sorting parameters are invalid for example: 'sort' => 'name', 'direction' => ''
*/
'default_first_column' => false,
/*
join type: join vs leftJoin (default leftJoin)
for more information see https://github.com/Kyslik/column-sortable/issues/59
*/
'join_type' => 'leftJoin',
];