<ejs-grid :editSettings='editSettings'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' defaultValue=1 textAlign='Right' :isPrimaryKey='true' width=100></e-column>
<e-column field='CustomerID' defaultValue='VINET' headerText='Customer ID' width=120></e-column>
</e-columns>
</ejs-grid> |
<ejs-grid :editSettings='editSettings'>
<e-columns>
<e-column field='ShipCountry' headerText='Ship Country' :editTemplate='editTemplate' width=150></e-column>
</e-columns>
</ejs-grid>
<script>
export default {
methods: {
editTemplate: function() {
return {
template: Vue.component('dropDownList', {
// Dropdownlist rendering code with datasource and default value specified
template: `<ejs-dropdownlist id='dropdownlist' value='France' :dataSource='this.datasource'></ejs-dropdownlist>`,
data() {
return {
// Data for the dropdownlist
datasource: ['Austria', 'Brazil', 'Belgium', 'Finland', 'France', 'Germany', 'Italy', 'Mexico', 'Spain', 'Sweden', 'Switzerland', 'UK', 'USA', 'Venezuela']
}
}
})
}
}
}
}
</script> |
<ejs-grid :editSettings='editSettings'>
<e-columns>
<e-column field='OrderID' :validationRules='validationRules' headerText='Order ID' defaultValue=1 textAlign='Right' :isPrimaryKey='true' width=100></e-column>
</e-columns>
</ejs-grid>
<script>
export default {
data() {
return {
data: data,
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true },
validationRules: { required: true }
};
},
}
</script> |
...
<script>
...
Vue.use(DropDownListPlugin);
export default {
...
methods: {
editTemplate: function() {
return {
template: Vue.component("dropDownList", {
template: `<ejs-dropdownlist id='dropdownlist' v-model="data.CustomerID" :dataSource='this.customerData'></ejs-dropdownlist>`,
data() {
return {
data: {},
customerData: [
"VINET",
...
]
};
}
})
};
}
}
};
</script> |