setPageNumber(tableRoot, pageItem.dataset.pageNumber);
}
+
+ const hide = e.target.closest(Selectors.table.links.hide);
+ if (hide) {
+ e.preventDefault();
+
+ hideColumn(tableRoot, hide.dataset.column);
+ }
+
+ const show = e.target.closest(Selectors.table.links.show);
+ if (show) {
+ e.preventDefault();
+
+ showColumn(tableRoot, show.dataset.column);
+ }
+
});
};
+
+ /**
+ * Fetch the table via its table region id
+ *
+ * @param {String} tableRegionId
+ * @returns {HTMLElement}
+ */
+ export const getTableFromId = tableRegionId => {
+ const tableRoot = document.querySelector(Selectors.main.fromRegionId(tableRegionId));
+
+
+ if (!tableRoot) {
+ // The table is not a dynamic table.
+ throw new Error("The table specified is not a dynamic table and cannot be updated");
+ }
+
+ return tableRoot;
+ };