DHTMLX / gantt

GPL version of Javascript Gantt Chart

Home Page:https://dhtmlx.com/docs/products/dhtmlxGantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'undefined' returned in tasksStore.$initItem

ali-spb opened this issue · comments

Currently using this patch as temp solution:

function patchGantt() {
  this.$initItem = function (item) {
    var loadedItem = item;
    if (this.$config.initItem) {
      loadedItem = this.$config.initItem(loadedItem);
    }
    var existingItem = this.getItem(item.id);
    if (existingItem && existingItem.parent != loadedItem.parent) {
      // PATCH: 'move' fn do not have return statement, removing 'return' keyword, otherwise we will return 'undefined'
      // return this.move(loadedItem.id, loadedItem.$index || -1, loadedItem.parent || this._ganttConfig.root_id);
      this.move(loadedItem.id, loadedItem.$index || -1, loadedItem.parent || this._ganttConfig.root_id);
    }
    return loadedItem;
  };
}

patchGantt.apply(Gantt.$data.tasksStore);

@ali-spb, that was fixed in the 7.1 version:
http://prnt.sc/12kvo2o