constructor(props) {
//...
this.priorityRules = {
minDate: [this.customFn, 'End Date must be greater that start date'], required: true
};
}
customFn(args) {
var obj = document.getElementById('Editing').ej2_instances[0];
var enddatevalue = args.value;
var startDate = window.rowData.ganttProperties.startDate;
if (new Date(enddatevalue).getTime() >= new Date(startDate).getTime())
return true;
return false;
};
<GanttComponent id = 'Editing' dataSource ={ editingData}
< ColumnsDirective >
//...
< ColumnDirective field = 'EndDate' validationRules ={ this.priorityRules}></ ColumnDirective >
</ ColumnsDirective >
/>
</GanttComponent>
|
Hi Pooja,
Does the "validationRules" property working on ej2-react-gantt version "20.1.50"? Tried on it but got an error.
Thanks
Hi Dmitry,
We have checked the issue from our side in version 20.1.50. It is not replicating for us and its working fine. We have shared a video for your reference. We request you to clear the browser cache and check. If still, you are facing the issue, please share the video demonstration, code snippets, and replication steps for the issue. It will be helpful for us to provide you with a better solution.
Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/validation-1472299933
Sample: https://stackblitz.com/edit/react-fbr9yi?file=package.json
Regards,
Premkumar S