diff --git a/src/main/webapp/resources/js/base/dataset.js b/src/main/webapp/resources/js/base/dataset.js index 9d04161..0a11e1b 100644 --- a/src/main/webapp/resources/js/base/dataset.js +++ b/src/main/webapp/resources/js/base/dataset.js @@ -896,6 +896,14 @@ class Dataset { } return result; } + + findData(filter, option) { + let found = this._items.filter(item => filter(item)); + if ("item" == option) + return found; + + return found.map(item => item.data); + } /**Returns whether the Dataset is dirty. * A Dataset is dirty if it has user data that is either added, modified, or removed. @@ -1582,6 +1590,10 @@ class DatasetControl { getDataset(option) { return this.dataset.getDataset(option); } + + findData(filter, option) { + return this.dataset.findData(filter, option); + } setData(obj, option = {}) { this.setPaging(obj, option); diff --git a/src/main/webapp/resources/js/base/menu-support.js b/src/main/webapp/resources/js/base/menu-support.js index caebaa1..465b582 100644 --- a/src/main/webapp/resources/js/base/menu-support.js +++ b/src/main/webapp/resources/js/base/menu-support.js @@ -9,7 +9,7 @@ class MenuSupport { this._selector = ifEmpty(conf.selector, "#menus"); this._containerSelector = ifEmpty(conf.containerSelector, "#layout-menu"); this._container = document.querySelector(this._containerSelector); - let onclick = conf.onclick || (menu => 'onclick="openMenu(\'{url}\')" '.replace(/{url}/gi, wctx.url(menu.url))); + let onclick = conf.onclick || (menu => 'onclick="openMenu(\'{url}\')" '.replace(/{url}/gi, menu.url)); this._onclick = (menu => menu && menu.url ? onclick(menu) : ""); this._horizontal = this._container && this._container.classList.contains('menu-horizontal');