Browse Source

gantt column by type

pull/1/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
207c9219c7
  1. 25
      edit-mode/function/function.js
  2. 3
      edit-mode/function/ganttSettings.js

25
edit-mode/function/function.js

@ -487,6 +487,31 @@ function updateShowHideColumn(data)
}); });
} }
function colAjaxReq(type) {
let ajx = $.ajax({
url: `${base_url}gantt-show-hide/get-column-by-type/${type}`,
type: "GET",
success: function (data) {
let ganttColumnsByType = data.data;
let isFound = false;
x = gantt.config.columns.filter((val) => {
isFound = ganttColumnsByType.find(obj => {
return obj.column_name == val.name;
});
if(isFound)
return val;
});
gantt.config.columns = x.filter(item => item);
allColumns = gantt.config.columns;
gantt.render();
}
});
}
async function reRenderColumns(type){
await colAjaxReq(type);
}
function updateProperty(payload){ function updateProperty(payload){
if(userToVersionGanttId > 0 && readOnly && parseInt(readOnly)==0){ if(userToVersionGanttId > 0 && readOnly && parseInt(readOnly)==0){
$.ajax({ $.ajax({

3
edit-mode/function/ganttSettings.js

@ -183,6 +183,8 @@ async function initGanttSettings() {
if (result && result.status==200){ if (result && result.status==200){
var config_dayoff = result.data.data.config_dayoff; var config_dayoff = result.data.data.config_dayoff;
var type_gantt = result.data.data.calculation_type;
reRenderColumns(type_gantt);
var dayoff = []; var dayoff = [];
if(config_dayoff && config_dayoff.length > 0){ if(config_dayoff && config_dayoff.length > 0){
dayoff = config_dayoff.split(','); dayoff = config_dayoff.split(',');
@ -252,7 +254,6 @@ function getColumnsSelection(node){
unselectedColumn.forEach(function(node){ unselectedColumn.forEach(function(node){
checkedColumns[node.name] = false; checkedColumns[node.name] = false;
}); });
// console.log("checkedColumns", checkedColumns)
return checkedColumns; return checkedColumns;
} }

Loading…
Cancel
Save