[App.Vue]
<ejs-grid
id="Grid"
ref="grid"
:dataSource="data"
:allowPaging="true"
:editSettings="editSettings"
:toolbar="toolbar"
:actionBegin="toolbarClick"
>
<e-columns>
<e-column field="OrderID" headerText="Order ID" width="90" isPrimaryKey="true"></e-column>
<e-column field="CustomerID" headerText="Customer ID" :validationRules="vRules" width="120"></e-column>
<e-column field="ShipCountry" headerText="Ship Country" width="150" ></e-column>
<e-column field="ShipCity" headerText="Ship City" width="120"></e-column>
<e-column field="Freight" headerText="Freight" format="C2" width="90"></e-column>
</e-columns>
</ejs-grid>
data() {
var temp = this;
return {
data: data,
vRules:{required:[this.customValidationFn,"CustomerID is required"]}, // Here, you can write your own Error message
. . . .
},
methods: {
customValidationFn: function(args){
if(args.value.length>0){
return true;
} else
return false;
},
},
. . . .
}
|