From 27a3bfbcb713bbdeda73be385c4d52de47743c03 Mon Sep 17 00:00:00 2001 From: Craig Winnall Date: Mon, 20 Jul 2026 15:19:10 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20/=20Stick=20header=20on=20open=20=5Fh?= =?UTF-8?q?sv=20=E2=80=94=20use=20=5Fsth=20height=20param=20when=20calling?= =?UTF-8?q?=20ktl.views.stickTableHeader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KTL.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/KTL.js b/KTL.js index 04fb2b1..473b7ba 100644 --- a/KTL.js +++ b/KTL.js @@ -18573,6 +18573,13 @@ function Ktl($, appInfo) { const viewStates = {}; + /** + * Adds hide/show controls to a view and restores dependent view features when it opens. + * + * @param {object} view Knack view being rendered. + * @param {object} keywords Parsed keywords for the view. + * @returns {void} + */ function hideShowView({ key: viewId }, keywords) { const kw = '_hsv'; if (!viewId || !keywords || !keywords[kw]) return; @@ -18705,7 +18712,9 @@ function Ktl($, appInfo) { hiddenSection.slideDown(delay, () => { const viewHasSTH = ktl.core.checkIfViewHasKeyword(viewId, '_sth'); if (viewHasSTH) { - ktl.views.stickTableHeader(viewId); + const stickyHeaderParams = keywords._sth?.[0]?.params?.[0] || []; + const viewHeight = stickyHeaderParams[1] || 800; + ktl.views.stickTableHeader(viewId, viewHeight); } const signatureElements = viewElement.find('.kn-input-signature'); From 901f2cac6dfcb02c88afce01bc620f2e4e0a3d64 Mon Sep 17 00:00:00 2001 From: Craig Winnall Date: Wed, 29 Jul 2026 11:03:25 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20/=20Stick=20header=20on=20open=20=5Fh?= =?UTF-8?q?sv=20=E2=80=94=20respect=20=5Fsth=20params=20(min=20rows,=20hei?= =?UTF-8?q?ght)=20and=20only=20enable=20sticky=20header=20when=20record=20?= =?UTF-8?q?count=20meets=20threshold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KTL.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/KTL.js b/KTL.js index 473b7ba..4bf6843 100644 --- a/KTL.js +++ b/KTL.js @@ -18710,11 +18710,14 @@ function Ktl($, appInfo) { } } else { hiddenSection.slideDown(delay, () => { - const viewHasSTH = ktl.core.checkIfViewHasKeyword(viewId, '_sth'); - if (viewHasSTH) { + if (keywords._sth) { const stickyHeaderParams = keywords._sth?.[0]?.params?.[0] || []; + const numOfRecords = stickyHeaderParams[0] || 10; const viewHeight = stickyHeaderParams[1] || 800; - ktl.views.stickTableHeader(viewId, viewHeight); + const rowCount = Knack.views[viewId]?.model?.data?.length || 0; + + if (rowCount >= numOfRecords) + ktl.views.stickTableHeader(viewId, viewHeight); } const signatureElements = viewElement.find('.kn-input-signature');