mxGraph - отключить перемещение ячеек пользователя, но включить менеджер раскладки - PullRequest
0 голосов
/ 21 марта 2020

Я попытался установить graph.setCellsMovable(false), но менеджер раскладки больше не работает. Я просто хочу включить только менеджер подключений и макет.

// if set this, layout manager not work
// this.graph.setCellsMovable(false);
this.graph.setCellsSelectable(false);

const layout = new mxStackLayout(this.graph, true);
layout.border = this.graph.border;

const layoutMgr = new mxLayoutManager(this.graph);
layoutMgr.getLayout = function (cell) {
  if(!cell.collapsed) {
    if (cell.parent != this.graph.model.root) {
      layout.resizeParent = true;
      layout.horizontal = false;
      layout.spacing = 10;
    } else {
      layout.resizeParent = true;
      layout.horizontal = true;
      layout.spacing = 40;
    }
    return layout;
  }
  return null;
};
...