Skip to content

Commit 1186e82

Browse files
update docs
1 parent d7f1ac3 commit 1186e82

File tree

2 files changed

+67
-65
lines changed

2 files changed

+67
-65
lines changed

_docs/1-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These two Laravel packages are for making easy and quickly dataTable for your wo
1111
## Table of contents
1212

1313
1. [Introduction](1-introduction.md)
14-
* [Quick Example](#Quick Example)
14+
* [Quick Example](#Quick-Example)
1515
2. [Installation and Setup](2-Installation-and-Setup.md)
1616
3. [Configuration](3-Configuration.md)
1717
4. [Usage](4-Usage.md)

_docs/3-Configuration.md

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,107 @@
77

88
## Configuration
99

10-
## client side
10+
## 1- client side
1111

1212

13-
**props datatable components**
13+
### props datatable components
1414

15-
**config**
15+
#### config
1616
```html
1717
// resources/posts/index.blade.php
1818

19-
<x-app-layout>
20-
21-
22-
23-
2419
<data-table
25-
2620
:config="{
27-
url: `/admin/places/all?page=1`,
28-
21+
url: `/posts/all?page=1`,
2922
toolbar:{
3023
show: true,
3124
delete: {
32-
url: `/${this.lang}/admin/places/destroy/all`
25+
url: `posts/destroy/all`
26+
show: `true`
3327
}
3428
},
35-
perPage: {
36-
show: true,
37-
counts: [5,10, 25, 50, 100, 250],
38-
},
39-
filter:{
40-
selection:{
41-
show: true,
42-
data:[
43-
{
44-
label: 'Admins',
45-
relation: 'createdBy',
46-
column: 'first_name',
47-
rows: {{json_encode($admins)}}
48-
49-
},
50-
]
51-
}
52-
}
5329
54-
}"
55-
30+
}"
31+
></data-table>
32+
33+
```
5634

35+
| Name | Type | Default | Description
36+
| --- | --- | --- | --- |
37+
| `url ` | String | "/" | (required) json data url |
38+
| `toolbar` | Object | {} | to setup toolbar |
39+
| `toolbar.show` | Bool | true | to disable or enable toolbar |
40+
| `toolbar.delete` | Object | {} | to add delete all option to toolbar |
41+
| `toolbar.delete.url` | String | '/' | to set delete all url |
42+
| `toolbar.delete.show` | Bool | true | to disable or enable delete button |
43+
| `search` | Object | {} | to setup search input |
44+
| `search.show` | Bool | true | disable or enable the feature |
45+
46+
47+
#### perPage
48+
```html
49+
// resources/posts/index.blade.php
50+
51+
<data-table
52+
:perPage="{
53+
show: true,
54+
counts: [5,10, 25, 50, 100, 250],
55+
}"
5756
></data-table>
5857

58+
```
59+
60+
| Name | Type | Default | Description
61+
| --- | --- | --- | --- |
62+
| `perPage` | Object | {} | to add rows count per page |
63+
| `perPage.show` | Bool | true | disable or enable the feature |
64+
| `perPage.count` | Array | [10, 25, 50, 100, 250] | to add rows counts you want to appear on a page |
65+
5966

6067

68+
#### filters
69+
```html
70+
// resources/posts/index.blade.php
6171

72+
<data-table
73+
:filters="{
74+
selection:{
75+
show: true,
76+
data:[
77+
{
78+
label: 'Admins',
79+
relation: 'createdBy',
80+
column: 'first_name',
81+
rows: {{json_encode($admins)}}
82+
83+
},
84+
]
85+
}
86+
}"
87+
></data-table>
6288

63-
</x-app-layout>
64-
}
6589
```
6690
|
6791

6892
| Name | Type | Default | Description
6993
| --- | --- | --- | --- |
70-
| `url ` | String | "/" | json data url |
71-
| `toolbar` | Object | {} | to add toolbar config |
72-
| `toolbar.show` | Object | {} | to disable or enable toolbar |
73-
| `toolbar.delete` | Object | {} | to add toolbar config |
74-
| `toolbar.delete.url` | Object | {} | to add toolbar config |
75-
| `perPage` | Object | {} | to add page rows count config |
76-
| `perPage.show` | Object | {} | disable or enable the feature |
77-
| `perPage.count` | Object | {} | to add rows counts you want to appear on a page |
7894
| `filter` | Object | {} | Add filters data |
7995
| `filter.selection` | Object | {} | the object contains all filter selection data |
80-
| `filter.selection.show` | Object | {} | to disable or enable selection filter |
96+
| `filter.selection.show` | Bool | true | to disable or enable selection filter |
8197
| `filter.selection.data` | Object | {} | the object is array contains all select input options |
82-
| `filter.selection.data.label` | Object | {} | name appears beside select input |
83-
| `filter.selection.data.relation` | Object | {} | relation name you will get it |
84-
| `filter.selection.data.column` | Object | {} | column you will get it |
85-
| `filter.selection.data.rows` | Object | {} | all rows from the database as JSON |
98+
| `filter.selection.data.label` | String | '' | name appears beside select input |
99+
| `filter.selection.data.relation` | String | '' | relation name you will get it |
100+
| `filter.selection.data.column` | String | '' | column name you will get it |
101+
| `filter.selection.data.rows` | Json | [{}] | all rows from the database as JSON |
102+
103+
86104

87105
**columns**
88106
```html
89107
// resources/posts/index.blade.php
90108

91-
<x-app-layout>
92-
93-
94-
95-
96109
<data-table
97-
98110
:columns="[
99-
100111
{
101112
label: 'Title',
102113
column: 'title',
@@ -110,16 +121,7 @@
110121
111122
]
112123
"
113-
114-
115124
></data-table>
116-
117-
118-
119-
120-
121-
</x-app-layout>
122-
}
123125
```
124126
|
125127

@@ -129,6 +131,6 @@
129131
| `column` | String | '' | database column name |
130132
| `show` | Bool | true | to add toolbar config |
131133
| `sort` | Object | {} | is responsible for sort column |
132-
| `sort.sortable` | Bool | true | if you want to use column for sorting |
134+
| `sort.sortable` | Bool | true | disable or enable sorting |
133135
| `sort.sortColumn` | String | '' | column name for sorting |
134136
| `sort.sortDir` | String | asc | sort direction for first sorting |

0 commit comments

Comments
 (0)