From b5451154ebb97ceb0e6eb8c7a5ad72f6cb988029 Mon Sep 17 00:00:00 2001 From: Rubanraj Date: Sat, 7 Sep 2019 13:01:50 +0200 Subject: [PATCH 1/7] Update README.md --- README.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d0bc4ee..ba2c2ef 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Table of Contents + [16.1.3. Step 3](#1613-step-3) + [16.1.4. Step 4](#1614-step-4) + [16.1.5. Note](#1615-note) + * [16.2. Loader overlay](#162-loader-overlay) - [17. Events](#17-events) * [17.1. on-select-row](#171-on-select-row) + [17.1.1. Payload (Object)](#1711-payload--object-) @@ -159,7 +160,7 @@ We are using **`lodash`** internally, so you don't need to install separately fo ... - + ``` **Note:** If you've included bootstrap & jQuery packages already in your project, then include only **vue-bootstrap4-table.min.js** script. @@ -1036,6 +1037,7 @@ You can add your custom buttons in the table by **`actions`** props and listen f @@ -1222,7 +1224,8 @@ You can optionally pass config as a prop to **`vue-bootstrap4-table`** component show_refresh_button: true, show_reset_button: true, server_mode: true, - preservePageOnDataChange: true + preservePageOnDataChange: true, + loaderText: 'Updating...', } } }, @@ -1259,6 +1262,7 @@ You can optionally pass config as a prop to **`vue-bootstrap4-table`** component | show_reset_button | Show/Hide Refresh button. Resets all query (sort, filter, global search) currently applied in the table. |Boolean | true | | server_mode | Enable/Disable server side processing (Sorting, Filtering, Global search & pagination) |Boolean | false | | preservePageOnDataChange | Enable/Disable preserving current index of the page on data change. For example, if this option is set to true, consider that you are in page **4** and performed some actions like sorting or filtering, then now table gets a new data and still the pagination will be in page **4**. If this config is set to false (default), for any data change current page in the pagination will be shifted to page **1**. |Boolean | false | +| loaderText | Overrides default loading text in the loader overlay | String | Loading... | # 16. Server mode @@ -1273,7 +1277,8 @@ In server mode, client side filtering, sorting, global search and pagination wil :columns="columns" :config="config" @on-change-query="onChangeQuery" - :totalRows="total_rows"> + :show-loader="showLoader" + :total-rows="total_rows"> @@ -1290,7 +1295,8 @@ In server mode, client side filtering, sorting, global search and pagination wil ], config: { ... - server_mode: true // by default false + server_mode: true, // by default false + loaderText: 'Updating...', // by default 'Loading...' ... }, queryParams: { @@ -1301,11 +1307,13 @@ In server mode, client side filtering, sorting, global search and pagination wil page: 1, }, total_rows: 0, + showLoader: true, } }, methods: { onChangeQuery(queryParams) { this.queryParams = queryParams; + this.showLoader = true; this.fetchData(); }, fetchData() { @@ -1319,8 +1327,10 @@ In server mode, client side filtering, sorting, global search and pagination wil .then(function(response) { self.rows = response.data.data; self.total_rows = response.data.total; + self.showLoader = false; }) .catch(function(error) { + self.showLoader = false; console.log(error); }); } @@ -1366,6 +1376,7 @@ Then listen for the event **`on-change-query`**. :columns="columns" :config="config" @on-change-query="onChangeQuery" + :show-loader="showLoader" :totalRows="total_rows"> ``` @@ -1377,6 +1388,7 @@ Wherever there is a change in table query params, you will get your new query pa ```javascript onChangeQuery(queryParams) { this.queryParams = queryParams; + this.showLoader = true; this.fetchData(); }, ``` @@ -1399,9 +1411,11 @@ fetchData() { .then(function(response) { self.rows = response.data.data; self.total_rows = response.data.total; + self.showLoader = false; }) .catch(function(error) { console.log(error); + self.showLoader = false; }); } ``` @@ -1423,6 +1437,15 @@ columns: [ ... ] ``` + +### 16.2. Loader overlay + +You may need to show a loader animation over the table while your request is busy with processing data on the server. You can show/hide the loader overlay by passing the prop **`show-loader`** to **`vue-bootstrap4-table`**. + +If you would like to change the loader default text **`Loading...`**, you could pass your custom text in the **`config`** param **`loaderText`** https://github.com/rubanraj54/vue-bootstrap4-table#15-config. + +Didn't like the default loader animation ??? No problem, you can use **`loader-overlay`** slot to use your custom loader animation. + # 17. Events ## 17.1. on-select-row From 6a4c72148121306b8ed0601fa9500a34e2ad32fe Mon Sep 17 00:00:00 2001 From: Wanderlei Borba Cordeiro Date: Wed, 5 Feb 2020 10:22:39 -0300 Subject: [PATCH 2/7] New feature made available to customize the placeholder in the paging component, for the "Go to page" field. --- package-lock.json | 27 ++++++++++++++++----------- src/App.vue | 5 ++++- src/components/Pagination.vue | 15 ++++++++++----- src/components/VueBootstrap4Table.vue | 4 +++- 4 files changed, 33 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1dce787..117ce7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,7 @@ { "name": "vue-bootstrap4-table", - "version": "1.1.2", + "version": "1.1.11", "lockfileVersion": 1, - "requires": true, "dependencies": { "@babel/code-frame": { "version": "7.0.0", @@ -13929,6 +13928,15 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -13962,15 +13970,6 @@ } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -14778,6 +14777,12 @@ } } }, + "vue-router": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.5.tgz", + "integrity": "sha512-BszkPvhl7I9h334GjckCh7sVFyjTPMMJFJ4Bsrem/Ik+B/9gt5tgrk8k4gGLO4ZpdvciVdg7O41gW4DisQWurg==", + "dev": true + }, "vue-style-loader": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-3.1.2.tgz", diff --git a/src/App.vue b/src/App.vue index 3e399d8..999c058 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,9 @@ @on-select-row="onSelectRows" @refresh-data="onRefreshData" :show-loader="showLoader" - @on-download="onDownload"> + @on-download="onDownload" + > +