<script>
function actionBegin(args) {
var ganttObj = document.getElementById("Gantt").ej2_instances[0];
if (args.requestType == "beforeOpenAddDialog") {
args.rowData.GUID = NewGuid();
} else if (args.requestType == "beforeAdd" && ganttObj.contextMenuModule.isOpen) {
args.data.GUID = args.data.taskData.GUID = NewGuid();
}
}
function NewGuid() {
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
guid = (S4() + S4() + "-" + S4() + "-4" + S4().substr(0, 3) + "-" + S4() + "-" + S4() + S4() + S4()).toLowerCase();
return guid;
}
</script> |