Browse Source

optimize load time

pull/1/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
b56037d61d
  1. 18
      src/function/ganttConfig.js
  2. 4
      src/function/restActivityLink.js

18
src/function/ganttConfig.js

@ -639,6 +639,24 @@ for (var i = 0; i < radios.length; i++) {
};
}
// end Zoom Scale function
//
//
// GANTT PERFORMANCE CONFIG RECOMMENDATION
gantt.config.scales = [
{unit: "month", step: 1, format: "%F, %Y"},
{unit: "week", step: 1, format: function (date) {
return "Week #" + gantt.date.getWeek(date);
}},
{unit: "day", step: 1, format: "%D", css: function(date) {
if(!gantt.isWorkTime({ date: date, unit: "day"})){
return "weekend"
}
}}
];
gantt.config.show_task_cells = false;
gantt.config.static_background = true;
gantt.config.branch_loading = true;
gantt.config.smart_scales = true;
// gantt initialization
$(document).ready(function () {

4
src/function/restActivityLink.js

@ -23,7 +23,9 @@ gantt.ajax.get({
isBaselineSet = false;
}
}
gantt.silent(function () {
gantt.parse(data);
});
});
function refresData(id){
@ -41,7 +43,9 @@ function refresData(id){
data['data'] = obj.data.data;
data['links'] = obj.data.links;
// console.log("data parse wrong", data);
gantt.silent(function () {
gantt.parse(data);
});
if(id){
if(gantt.isTaskExists(id)){
expandTask();

Loading…
Cancel
Save