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/columns/available-methods.md
-117Lines changed: 0 additions & 117 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,69 +7,7 @@ weight: 3
7
7
8
8
To change the CSS classes or other attributes assigned to a Column, use can use [setTdAttributes](../datatable/styling), which allows customising attributes based on column type, name or value.
9
9
10
-
## Sorting
11
10
12
-
See also [component sorting configuration](../sorting/available-methods).
13
-
14
-
To enable sorting you can chain the `sortable` method on your column:
15
-
16
-
```php
17
-
Column::make('Name')
18
-
->sortable(),
19
-
```
20
-
21
-
If you would like more control over the sort behavior of a specific column, you may pass a closure:
By default, there is no default column sorting and the table will be displayed in the order the query has it listed. To enable default sorting you can use this method on your component:
46
-
47
-
```php
48
-
public function configure(): void
49
-
{
50
-
$this->setDefaultSort('name', 'desc');
51
-
}
52
-
```
53
-
54
-
## Searching
55
-
56
-
See also [component search configuration](../search/available-methods).
57
-
58
-
To enable searching you can chain the `searchable` method on your column:
59
-
60
-
```php
61
-
Column::make('Name')
62
-
->searchable(),
63
-
```
64
-
65
-
You can override the default search query using a closure:
@@ -177,62 +115,7 @@ Column::make('My one off column')
177
115
->html(),
178
116
```
179
117
180
-
## Collapsing
181
118
182
-
The component has the ability to collapse certain columns at different screen sizes. It will add a plus icon as the left most column that will open up a view below the row with the information of the collapsed columns:
183
-
184
-

185
-
186
-
You have 3 options when it comes to collapsing.
187
-
188
-
Collapse Always:
189
-
190
-
```php
191
-
Column::make('Name')
192
-
->collapseAlways(),
193
-
```
194
-
The columns will always be collapsed
195
-
196
-
Collapse on tablet:
197
-
198
-
```php
199
-
Column::make('Name')
200
-
->collapseOnTablet(),
201
-
```
202
-
203
-
The columns will collapse on tablet and mobile.
204
-
205
-
Collapse on mobile:
206
-
207
-
```php
208
-
Column::make('Name')
209
-
->collapseOnMobile(),
210
-
```
211
-
212
-
The column will collapse on mobile only.
213
-
214
-
The view will be rendered with the order of the columns as they were initially shown.
215
-
216
-
## Customization
217
-
218
-
### Customizing sorting pill names
219
-
220
-
You can customize the name on the pill for the specific column that's being sorted:
221
-
222
-
```php
223
-
Column::make('Name')
224
-
->setSortingPillTitle('Full Name'),
225
-
```
226
-
227
-
### Customizing sorting pill directions
228
-
229
-
You can customize the directions on the pill for the specific column that's being sorted:
The component has the ability to collapse certain columns at different screen sizes. It will add a plus icon as the left most column that will open up a view below the row with the information of the collapsed columns:
10
+
11
+

12
+
13
+
You have 3 options when it comes to collapsing.
14
+
15
+
Collapse Always:
16
+
17
+
```php
18
+
Column::make('Name')
19
+
->collapseAlways(),
20
+
```
21
+
The columns will always be collapsed
22
+
23
+
Collapse on tablet:
24
+
25
+
```php
26
+
Column::make('Name')
27
+
->collapseOnTablet(),
28
+
```
29
+
30
+
The columns will collapse on tablet and mobile.
31
+
32
+
Collapse on mobile:
33
+
34
+
```php
35
+
Column::make('Name')
36
+
->collapseOnMobile(),
37
+
```
38
+
39
+
The column will collapse on mobile only.
40
+
41
+
The view will be rendered with the order of the columns as they were initially shown.
By default, there is no default column sorting and the table will be displayed in the order the query has it listed. To enable default sorting you can use this method on your component:
42
+
43
+
```php
44
+
public function configure(): void
45
+
{
46
+
$this->setDefaultSort('name', 'desc');
47
+
}
48
+
```
49
+
50
+
51
+
52
+
## Customization
53
+
54
+
### Customizing sorting pill names
55
+
56
+
You can customize the name on the pill for the specific column that's being sorted:
57
+
58
+
```php
59
+
Column::make('Name')
60
+
->setSortingPillTitle('Full Name'),
61
+
```
62
+
63
+
### Customizing sorting pill directions
64
+
65
+
You can customize the directions on the pill for the specific column that's being sorted:
0 commit comments