Hi
I want to bind a dropdown list in a grid using cell template.
While using state in a cell template I am getting error store state is undefined.
Cell template is something like below.
const cellPurchaseCategoryTemplate = Vue.extend({
props: {
field: String,
dataItem: Object,
format: String,
className: String,
columnIndex: Number,
columnsCount: Number,
rowType: String,
level: Number,
expanded: Boolean,
editor: String
},
computed: {
purchaseCategoryList(): Array<CategoryChildCodeData> {
if (this.purchaseCategories) {
return Utility.cloneObject(this.purchaseCategories);
}
},
...invoiceApprovalStoreHelpers.mapState(["purchaseCategories"])
},
template: `<td>
<cvc-autocomplete v-model="dataItem.category"
v-bind:data-source="purchaseCategoryList"
v-bind:name="assignFieldName(field, dataItem)"
v-validate="'required'"
data-vv-as="Purchase Category">
</cvc-autocomplete>
</td>`
});
export default cellPurchaseCategoryTemplate;