diff options
author | Andrew Dolgov <[email protected]> | 2018-12-06 09:52:12 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-06 09:52:12 +0300 |
commit | 0e25f5d512addb7702a3b1916c770c1a661a6405 (patch) | |
tree | a8eab9a72d8728da567f457bddb111aef3ef406a /js/common.js | |
parent | 40204618bfbaf7f18b4872ddecefa012c98ac746 (diff) |
add Lists.select() and make filter dialogs use it
Diffstat (limited to 'js/common.js')
-rwxr-xr-x | js/common.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/common.js b/js/common.js index 427e3034c..150288bc2 100755 --- a/js/common.js +++ b/js/common.js @@ -56,7 +56,23 @@ const Lists = { if (row) checked ? row.addClassName("Selected") : row.removeClassName("Selected"); - } + }, + select: function(elemId, selected) { + $(elemId).select("li").each((row) => { + const checkNode = row.select(".dijitCheckBox,input[type=checkbox]")[0]; + if (checkNode) { + const widget = dijit.getEnclosingWidget(checkNode); + + if (widget) { + widget.attr("checked", selected); + } else { + checkNode.checked = selected; + } + + this.onRowChecked(widget); + } + }); + }, }; // noinspection JSUnusedGlobalSymbols |