From 5c019beaaff0859f3d8b4ad082910001f5a5d06c Mon Sep 17 00:00:00 2001 From: Muhammad Sulaiman Yusuf Date: Tue, 29 Nov 2022 18:30:58 +0700 Subject: [PATCH] temp: reenable editor --- edit-mode/function/ganttConfig.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/edit-mode/function/ganttConfig.js b/edit-mode/function/ganttConfig.js index d32e10e..76704fd 100644 --- a/edit-mode/function/ganttConfig.js +++ b/edit-mode/function/ganttConfig.js @@ -347,14 +347,17 @@ var allColumns = [ ` } }, // { name: "status", label: "Status", align: "center", editor: editor.status, resize: true }, - { name: "bobot_planning", label: "Bobot Activity (%)", align: "center", resize: true, min_width: 115, template: function (text) { + { name: "bobot_planning", label: "Bobot Activity (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) { + if(text.bobot_planning > 100){ + gantt.alert("Bobot tidak boleh lebih dari 100%!"); + } if(!text.bobot_planning){ return } let bobot_planning = parseFloat(text.bobot_planning); return roundToTwo(bobot_planning); } }, - { name: "progress", label: "Actual Progress (%)", align: "center", min_width: 125, template: function (text) { + { name: "progress", label: "Actual Progress (%)", align: "center", editor: progressEditor ,min_width: 125, template: function (text) { let progress = text.progress progress = progress*100 return roundToTwo(progress); @@ -362,6 +365,9 @@ var allColumns = [ { name:"progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) { let progress = text.progress progress = progress*100 + if(progress > 100){ + gantt.alert("Bobot tidak boleh lebih dari 100%!"); + } let bobot = text.bobot_planning let actual = (progress*bobot) / 100 return roundToTwo(actual);