fix pagination and pagesize on pages with more than one table
This commit is contained in:
parent
f25b34ea97
commit
3c5ac66af3
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
window.utils.asyncTable = function(wrapper, options) {
|
window.utils.asyncTable = function(wrapper, options) {
|
||||||
|
|
||||||
var tableIdent = #{String dbtIdent};
|
var tableIdent = wrapper.dataset.dbtIdent;
|
||||||
var shortCircuitHeader = #{String (toPathPiece HeaderDBTableShortcircuit)};
|
var shortCircuitHeader = #{String (toPathPiece HeaderDBTableShortcircuit)};
|
||||||
|
|
||||||
var ths = [];
|
var ths = [];
|
||||||
@ -14,7 +14,7 @@
|
|||||||
var scrollTable;
|
var scrollTable;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
var table = wrapper.querySelector('#' + tableIdent);
|
var table = wrapper.querySelector('#' + tableIdent);
|
||||||
if (!table) {
|
if (!table) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (pagesizeForm) {
|
if (pagesizeForm) {
|
||||||
var pagesizeSelect = pagesizeForm.querySelector('[name=' + tableIdent + '-pagesize]')
|
var pagesizeSelect = pagesizeForm.querySelector('[name=' + tableIdent + '-pagesize]');
|
||||||
pagesizeSelect.addEventListener('change', changePagesizeHandler);
|
pagesizeSelect.addEventListener('change', changePagesizeHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,9 +167,11 @@
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
var selector = '#' + #{String $ dbtIdent} + '-table-wrapper:not(.js-initialized)';
|
var dbtIdent = #{String $ dbtIdent};
|
||||||
|
var selector = '#' + dbtIdent + '-table-wrapper:not(.js-initialized)';
|
||||||
var wrapper = document.querySelector(selector);
|
var wrapper = document.querySelector(selector);
|
||||||
if (wrapper) {
|
if (wrapper) {
|
||||||
|
wrapper.dataset.dbtIdent = dbtIdent;
|
||||||
window.utils.asyncTable(wrapper);
|
window.utils.asyncTable(wrapper);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user