Skip to content

Commit 625f13c

Browse files
committed
updated section numbers in readme
1 parent f02cc2f commit 625f13c

File tree

2 files changed

+23
-97
lines changed

2 files changed

+23
-97
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,11 @@ You can optionally pass config as a prop to **`vue-bootstrap4-table`** component
803803
| show_reset_button | Show/Hide Refresh button. Resets all query (sort, filter, global search) currently applied in the table. |Boolean | true |
804804
| server_mode | Enable/Disable server side processing (Sorting, Filtering, Global search & pagination) |Boolean | false |
805805

806-
# Server mode
806+
# 14. Server mode
807807

808808
In server mode, client side filtering, sorting, global search and pagination will be disabled. Instead your server will do all this and returns only the processed response. New response will update the rows in the table.
809809

810-
## Example
810+
## 14.1. Example
811811

812812
```vue
813813
<template>
@@ -883,7 +883,7 @@ In server mode, client side filtering, sorting, global search and pagination wil
883883
</style>
884884
```
885885

886-
### Step 1
886+
### 14.1.1. Step 1
887887

888888
In your application you should have the below information in **`data.`**
889889

@@ -898,7 +898,7 @@ queryParams: {
898898
total_rows: 0,
899899
```
900900

901-
### Step 2
901+
### 14.1.2. Step 2
902902

903903
If you want to work with pagination, then don't forget to set **`total_rows`** as prop to **`totalRows`**.
904904

@@ -913,7 +913,7 @@ Then listen for the event **`on-change-query`**.
913913
</vue-bootstrap4-table>
914914
```
915915

916-
### Step 3
916+
### 14.1.3. Step 3
917917

918918
Wherever there is a change in table query params, you will get your new query params in your **`onChangeQuery`** function. With the new values update your **`queryParams`** and fetch new data from server.
919919

@@ -924,7 +924,7 @@ onChangeQuery(queryParams) {
924924
},
925925
```
926926

927-
### Step 4
927+
### 14.1.4. Step 4
928928

929929
I assume you are using **`axios`** library for handling ajax requests.
930930

@@ -948,55 +948,55 @@ fetchData() {
948948
});
949949
}
950950
```
951-
# 14. Events
951+
# 15. Events
952952

953-
## 14.1. on-select-row
953+
## 15.1. on-select-row
954954

955955
Triggered after selecting a row.
956956

957-
### 14.1.1. Payload (Object)
957+
### 15.1.1. Payload (Object)
958958

959959
| Attribute| Description |
960960
|--|--|
961961
|selected_items | List of currently selected rows |
962962
| selected_item | Currently selected item |
963963

964-
## 14.2. on-all-select-rows
964+
## 15.2. on-all-select-rows
965965

966966
Triggers after clicking select all check box.
967967

968-
### 14.2.1. Payload (Object)
968+
### 15.2.1. Payload (Object)
969969

970970
| Attribute| Description |
971971
|--|--|
972972
|selected_items | List of currently selected rows |
973973

974-
## 14.3. on-unselect-row
974+
## 15.3. on-unselect-row
975975

976976
Triggered after deselecting a row.
977977

978-
### 14.3.1. Payload (Object)
978+
### 15.3.1. Payload (Object)
979979

980980
| Attribute| Description |
981981
|--|--|
982982
|selected_items | List of currently selected rows |
983983
| unselected_item |Currently deselected item |
984984

985-
## 14.4. on-all-unselect-rows
985+
## 15.4. on-all-unselect-rows
986986

987987
Triggers after clicking deselect all check box.
988988

989-
### 14.4.1. Payload (Object)
989+
### 15.4.1. Payload (Object)
990990

991991
| Attribute| Description |
992992
|--|--|
993993
|selected_items | List of currently selected rows |
994994

995-
## 14.5. refresh-data
995+
## 15.5. refresh-data
996996

997997
Triggers after clicking refresh button. This event doesn't carry any payload.
998998

999-
# 15. Build Setup
999+
# 16. Build Setup
10001000

10011001
``` bash
10021002
# install dependencies

src/AppServer.vue

Lines changed: 6 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
<template>
22
<div id="app">
3-
<vue-bootstrap4-table :rows="rows" :columns="columns" :config="config" :actions="actions" @on-select-row="onSelectRows" @refresh-data="onRefreshData" @on-change-query="onChangeQuery" @on-download="onDownload" :totalRows="total_rows">
4-
<template slot="pagination-info" slot-scope="props">
5-
This page total is {{props.currentPageRowsLength}} |
6-
Filterd results total is {{props.filteredRowsLength}} |
7-
Original data total is {{props.originalRowsLength}}
8-
</template>
9-
10-
<template slot="refresh-button-text">
11-
⟳ my refresh
12-
</template>
13-
14-
<template slot="reset-button-text">
15-
⟳ my reset
16-
</template>
3+
<vue-bootstrap4-table :rows="rows"
4+
:columns="columns"
5+
:config="config"
6+
@on-change-query="onChangeQuery"
7+
:totalRows="total_rows">
178
</vue-bootstrap4-table>
189
</div>
1910
</template>
@@ -108,84 +99,19 @@
10899
}
109100
})
110101
.then(function(response) {
111-
console.log(response);
112-
113102
self.rows = response.data.data;
114103
self.total_rows = response.data.total;
115104
})
116105
.catch(function(error) {
117106
console.log(error);
118107
});
119-
},
120-
onSelectRows(payload) {
121-
console.log(payload);
122-
},
123-
onDownload(payload) {
124-
alert(payload.msg)
125-
console.log(payload);
126-
},
127-
onRefreshData() {
128-
let dummy = [{
129-
"name": {
130-
"first_name": "asdf",
131-
"last_name": "afds"
132-
},
133-
"id": 1,
134-
"age": 27,
135-
"address": {
136-
"city": "Port asdf",
137-
"street": "311 Marlen Skyway Suite 457",
138-
"postcode": "59419",
139-
"country": "Mayotte"
140-
},
141-
"salary": 2574,
142-
"email": "franecki.asfd@gmail.com",
143-
"website": "reichert.info",
144-
"mobile": "+1-704-796-2565"
145-
}, {
146-
"name": {
147-
"first_name": "xcv",
148-
"last_name": "asdf"
149-
},
150-
"id": 2,
151-
"age": 23,
152-
"address": {
153-
"city": "asdf",
154-
"street": "asdf Tiara Valleys",
155-
"postcode": "df-4010",
156-
"country": "sdfa"
157-
},
158-
"salary": 2126,
159-
"email": "rlittle@macejkovic.biz",
160-
"website": "wisoky.com",
161-
"mobile": "+asf"
162-
}, {
163-
"name": {
164-
"first_name": "asdfsdf",
165-
"last_name": "asdf"
166-
},
167-
"id": 3,
168-
"age": 30,
169-
"address": {
170-
"city": "asf",
171-
"street": "7729 Ashleigh Radial Apt. 649",
172-
"postcode": "54914-6608",
173-
"country": "Papua New Guinea"
174-
},
175-
"salary": 3805,
176-
"email": "delasfia.becker@cormier.com",
177-
"website": "ksdfuhlman.com",
178-
"mobile": "220.872.2938 x35208"
179-
}];
180-
181-
this.rows = dummy;
182108
}
109+
183110
},
184111
components: {
185112
VueBootstrap4Table
186113
},
187114
mounted() {
188-
let self = this;
189115
this.fetchData();
190116
},
191117
}

0 commit comments

Comments
 (0)