浏览代码

fix: refresh tree when the treeview is loaded

version-14
hrwx 2 年前
父节点
当前提交
fb0bc3bdcd
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      frappe/public/js/frappe/views/treeview.js

+ 13
- 0
frappe/public/js/frappe/views/treeview.js 查看文件

@@ -21,6 +21,19 @@ frappe.views.TreeFactory = class TreeFactory extends frappe.views.Factory {
frappe.views.trees[options.doctype] = new frappe.views.TreeView(options);
});
}

on_show() {
/**
* When the the treeview is visited using the previous button,
* the framework just show the treeview element that is hidden.
* Due to this, the data of the tree can be old.
* To deal with this, the tree will be refreshed whenever the
* treeview is visible.
*/
let route = frappe.get_route();
let treeview = frappe.views.trees[route[1]];
treeview && treeview.make_tree();
}
}

frappe.views.TreeView = class TreeView {


正在加载...
取消
保存