Commit 446c51ff authored by esatakpunar's avatar esatakpunar

search event changed state

parent da371342
...@@ -7,7 +7,6 @@ export default { ...@@ -7,7 +7,6 @@ export default {
return { return {
selected: [], selected: [],
column: "all", column: "all",
search: "",
}; };
}, },
computed: { computed: {
...@@ -24,6 +23,8 @@ export default { ...@@ -24,6 +23,8 @@ export default {
"editedIndex", "editedIndex",
"getOptions", "getOptions",
"totalProducts", "totalProducts",
"getSearch",
"filterColumn",
]), ]),
indexofColumn() { indexofColumn() {
...@@ -58,6 +59,15 @@ export default { ...@@ -58,6 +59,15 @@ export default {
this.setSingleExpand(data); this.setSingleExpand(data);
}, },
}, },
search: {
get() {
return this.getSearch;
},
set(data) {
this.setSearch(data);
},
},
}, },
methods: { methods: {
...mapActions("products", [ ...mapActions("products", [
...@@ -70,6 +80,7 @@ export default { ...@@ -70,6 +80,7 @@ export default {
"setExpanded", "setExpanded",
"setSingleExpand", "setSingleExpand",
"setOptions", "setOptions",
"setSearch",
]), ]),
}, },
created() { created() {
...@@ -122,9 +133,11 @@ export default { ...@@ -122,9 +133,11 @@ export default {
<v-btn <v-btn
icon icon
large large
color="blue-grey" color="blue"
class="white--text" class="white--text"
@click="fetchProductData" @click="
fetchProductData({ searchInput: search, filterColumn: column })
"
> >
<v-icon>refresh</v-icon> <v-icon>refresh</v-icon>
</v-btn> </v-btn>
...@@ -167,7 +180,15 @@ export default { ...@@ -167,7 +180,15 @@ export default {
<v-btn color="blue darken-1" @click="closeDialog()" <v-btn color="blue darken-1" @click="closeDialog()"
>Cancel</v-btn >Cancel</v-btn
> >
<v-btn color="blue darken-1" @click="saveProduct()"> <v-btn
color="blue darken-1"
@click="
saveProduct({
searchInput: search,
filterColumn: column,
})
"
>
Save</v-btn Save</v-btn
> >
</template> </template>
......
...@@ -30,4 +30,7 @@ export default { ...@@ -30,4 +30,7 @@ export default {
setTotalProducts(state, data) { setTotalProducts(state, data) {
state.totalProducts = data; state.totalProducts = data;
}, },
setSearch(state, data) {
state.search = data;
},
}; };
...@@ -7,6 +7,7 @@ export default () => ({ ...@@ -7,6 +7,7 @@ export default () => ({
editedItem: {}, editedItem: {},
dialog: false, dialog: false,
loading: false, loading: false,
options: {}, options: { sortDesc: [false] },
totalProducts: 0, totalProducts: 0,
search: "",
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment