Dataset.findData() 추가, MenuSupport onclick 수정

master
mjkhan21 2 months ago
parent be2216dff5
commit 54217649b8

@ -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);

@ -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');

Loading…
Cancel
Save