From cbaab44d0831348f5455038e771a72db5a769ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Wed, 14 Dec 2022 14:40:39 +0100 Subject: [PATCH] jsdialog: add TreeView JSON documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Szymon Kłos Change-Id: I7bc259eb43a42cc79bb1d7ceaaca60eea63e7410 --- .../src/control/jsdialog/Widget.TreeView.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/browser/src/control/jsdialog/Widget.TreeView.js b/browser/src/control/jsdialog/Widget.TreeView.js index dd97990c5..695d5db3e 100644 --- a/browser/src/control/jsdialog/Widget.TreeView.js +++ b/browser/src/control/jsdialog/Widget.TreeView.js @@ -1,6 +1,31 @@ /* -*- js-indent-level: 8 -*- */ /* * JSDialog.TreeView - tree view widget with or without header + * + * Example JSON: + * a) without header + * { + * id: 'id', + * type: 'treelistbox', + * entries: [ + * { row: 0, text: 'first entry', children: [ { row: 2, text: 'first subentry' } ] }, + * { row: 1, text: 'second entry', selected: true, state: false } + * ] + * } + * + * b) with headers + * { + * id: 'id', + * type: 'treelistbox', + * headers: [ { text: 'first column' }, { text: 'second' }], + * entries: [ + * { row: 0, columns [ { text: 'a' }, { text: 'b' } ] }, + * { row: 1, columns [ { text: 'a2' }, { text: 'b2' }, selected: true ]} + * ] + * } + * + * 'row' property is used in the callback to differentiate entries + * 'state' property defines if entry has the checkbox (false/true), when is missing - no checkbox */ /* global $ JSDialog */