Skip to content

Commit

Permalink
This fixes #2 , hiding extra rows, new version 1.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
rubanraj54 committed Jan 1, 2019
1 parent 9cfd207 commit a52ec1e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-bootstrap4-table",
"version": "1.0.11",
"version": "1.0.12",
"main": "dist/vue-bootstrap4-table.umd.js",
"module": "dist/vue-bootstrap4-table.esm.js",
"unpkg": "dist/vue-bootstrap4-table.min.js",
Expand Down
50 changes: 24 additions & 26 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,22 @@
columns: [{
label: "id",
name: "id",
filter: {
type: "simple",
placeholder: "id"
},
// filter: {
// type: "simple",
// placeholder: "id"
// },
sort: true,
row_text_alignment: "text-right",
column_text_alignment: "text-right",
// row_classes: "myrowclassone myrowclasstwo",
// column_classes: "column-class-one column-class-two"
// uniqueId: true
},
{
label: "First Name",
name: "name.first_name",
filter: {
type: "simple",
placeholder: "Enter first name"
},
// filter: {
// type: "simple",
// placeholder: "Enter first name"
// },
sort: true,
row_text_alignment: "text-left",
column_text_alignment: "text-right",
Expand All @@ -56,21 +54,21 @@
{
label: "Last Name",
name: "name.last_name",
filter: {
type: "simple",
placeholder: "Enter last name",
case_sensitive: true
},
// filter: {
// type: "simple",
// placeholder: "Enter last name",
// case_sensitive: true
// },
sort: true,
row_classes: ["myrowclassone","myrowclasstwo"]
},
{
label: "Email",
name: "email",
filter: {
type: "simple",
placeholder: "Enter email"
},
// filter: {
// type: "simple",
// placeholder: "Enter email"
// },
sort: true,
row_text_alignment: "text-left",
column_text_alignment: "text-left",
Expand All @@ -83,10 +81,10 @@
{
label: "Country",
name: "address.country",
filter: {
type: "simple",
placeholder: "Enter country"
},
// filter: {
// type: "simple",
// placeholder: "Enter country"
// },
},
],
config: {
Expand All @@ -102,12 +100,12 @@
card_title: "Vue Bootsrap 4 advanced table",
global_search: {
placeholder: "Enter custom Search text",
visibility: true,
visibility: false,
case_sensitive: false // default false
},
per_page_options: [5, 10, 20, 30],
show_reset_button: true,
show_refresh_button: true,
show_reset_button: false,
show_refresh_button: false,
server_mode: false
},
msg: "msg from parent",
Expand Down
13 changes: 12 additions & 1 deletion src/components/VueBootstrap4Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</tr>
</thead>
<tbody>
<tr class="table-active">
<tr class="table-active" v-if="showFilterRow">
<td v-show="checkbox_rows"></td>
<td v-for="(column, key, index) in vbt_columns" :key="index">
<Simple v-if="hasFilter(column)" :column="column" @update-filter="updateFilter" @clear-filter="clearFilter"></Simple>
Expand Down Expand Up @@ -963,6 +963,17 @@ export default {
showToolsRow() {
return (this.global_search.visibility == true || this.show_refresh_button == true || this.show_reset_button == true || this.actions.length > 0);
},
showFilterRow() {
let show_row = false;
_.forEach(this.columns,function(column,key) {
if (_.has(column, "filter")) {
show_row = true;
return false;
}
});
return show_row;
}
},
Expand Down

0 comments on commit a52ec1e

Please sign in to comment.