Doctype TreeView in Dialog?

Hi there,

i need to show a Doctype TreeView in Dialog (i.e. Warehouse, Item Group), so that will be possible to select a group from tree?

Any hint?


were you able to find a way? Looking for the same.

I’m thinking of applying this @JoEz

@johnskywalker sound nice …

@JoEz got it working


What is the use case?

Great … :clap::clap::clap:

Let’s say you want to show item group tree path in the item and not just it’s group


Yes this is correct. I’m using this now

1 Like

use case : if you have scanners and OCRed your invoice then the data can appear in a tree format.

1 Like

@johnskywalker any chance to share the code?

1 Like

yes just add files under “dist” from this repo and to the following directories:


edit your build.json and add the path of the files
OR your should have like this:

app_include_css = “/assets/erpnext_ocr/css/treeview.min.css”
app_include_js = “/assets/erpnext_ocr/js/treeview.min.js”

and then

var tree = new TreeView([
{ name: ‘Item 1’, children: [] },
{ name: ‘Item 2’, expanded: true, children: [
{ name: ‘Sub Item 1’, children: [] },
{ name: ‘Sub Item 2’, children: [] }
], ‘tree’);

No need for the

var TreeView = require(‘js-treeview’);

1 Like