[object Object]

← back to Commercialrealestate

crcp list pages: resize handles survive sort/search re-render (5 pages)

1c3f373e042a6d1beb1200b92ae10bbba39a4067 · 2026-07-31 11:24:49 -0700 · Steve Abrams

mls, rent-rolls, sales, fha-loans, gov-agents each rebuild <thead> innerHTML on
render(), wiping col-resize.js's drag handles — so columns couldn't be resized
after the first sort/search (handles only rebuilt on a column-SET change). Added
the ColResize.reattach() else-branch (same fix already on broker-grid) so handles
re-wire on every same-column re-render while preserving colgroup widths.

Verified via headless Playwright drag test (sort → drag +80px → assert width
delta, twice): all 5 resize exactly +80/+80, no double-wire, no dead handles,
0 pageerrors. TK-10089. Deferred: index.html + condos.html (different render
pattern, next cycle).

Files touched

Diff

commit 1c3f373e042a6d1beb1200b92ae10bbba39a4067
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Fri Jul 31 11:24:49 2026 -0700

    crcp list pages: resize handles survive sort/search re-render (5 pages)
    
    mls, rent-rolls, sales, fha-loans, gov-agents each rebuild <thead> innerHTML on
    render(), wiping col-resize.js's drag handles — so columns couldn't be resized
    after the first sort/search (handles only rebuilt on a column-SET change). Added
    the ColResize.reattach() else-branch (same fix already on broker-grid) so handles
    re-wire on every same-column re-render while preserving colgroup widths.
    
    Verified via headless Playwright drag test (sort → drag +80px → assert width
    delta, twice): all 5 resize exactly +80/+80, no double-wire, no dead handles,
    0 pageerrors. TK-10089. Deferred: index.html + condos.html (different render
    pattern, next cycle).
---
 public/fha-loans.html  | 1 +
 public/gov-agents.html | 1 +
 public/mls.html        | 1 +
 public/rent-rolls.html | 1 +
 public/sales.html      | 1 +
 5 files changed, 5 insertions(+)

diff --git a/public/fha-loans.html b/public/fha-loans.html
index 2d5f3e2..dac70a3 100644
--- a/public/fha-loans.html
+++ b/public/fha-loans.html
@@ -344,6 +344,7 @@ function render(){
   else $('#femptymsg').style.display='none';
   const csig=cols.map(c=>c.k).join(',');
   if(csig!==lastColSig){ lastColSig=csig; reinitResize(); }
+  else if(window.ColResize && window.ColResize.reattach){ window.ColResize.reattach(document.querySelector('#ftable')); } // resize handles survive sort/search re-render (TK-10089)
 }
 
 // ── expandable row → detail modal (all fields) ───────────────────────────────
diff --git a/public/gov-agents.html b/public/gov-agents.html
index da87163..4ecfaf3 100644
--- a/public/gov-agents.html
+++ b/public/gov-agents.html
@@ -181,6 +181,7 @@ function render(){
   $('#note').innerHTML=`Source: <b>${esc(META.source||'?')}</b> · ${esc(META.label||'')}`+(capped?` <span class="cap">— server returned ${AGENTS.length.toLocaleString()} of ${META.total.toLocaleString()} matches; refine your search to narrow.</span>`:'');
   const csig=cols.map(c=>c.k).join(',');
   if(csig!==lastColSig){ lastColSig=csig; reinitResize(); }
+  else if(window.ColResize && window.ColResize.reattach){ window.ColResize.reattach(document.querySelector('.tblwrap table.g')); } // resize handles survive sort/search re-render (TK-10089)
 }
 let ROWS=[];
 // ── expandable row: click a row for full detail (all fields) ──
diff --git a/public/mls.html b/public/mls.html
index de4fcda..15ab423 100644
--- a/public/mls.html
+++ b/public/mls.html
@@ -192,6 +192,7 @@ function paintBody(){
     }).join('')+'</tr>').join('');
     const csig=cols.map(c=>c.k).join(',');
     if(csig!==lastColSig){ lastColSig=csig; reinitResize(); }
+    else if(window.ColResize && window.ColResize.reattach){ window.ColResize.reattach(document.querySelector('#tableView table.mls')); } // resize handles survive sort/search re-render (TK-10089)
   } else {
     $('#tableView').classList.add('hide'); $('#gridView').classList.remove('hide');
     const bodyCols=cols.filter(c=>!['address','city','zip','type'].includes(c.k));
diff --git a/public/rent-rolls.html b/public/rent-rolls.html
index ba5136c..932fdd9 100644
--- a/public/rent-rolls.html
+++ b/public/rent-rolls.html
@@ -300,6 +300,7 @@ function render(){
     $('#tbody').innerHTML=rows.map(r=>`<tr class="rrow" data-id="${r.id}" style="cursor:pointer">`+cols.map(c=>{const cls=(c.t==='n'||c.t==='money'||c.t==='pct')?' class="n"':'';return `<td${cls}>${cell(r,c)}</td>`;}).join('')+'</tr>').join('');
     const csig=cols.map(c=>c.k).join(',');
     if(csig!==lastColSig){ lastColSig=csig; reinitResize(); }
+    else if(window.ColResize && window.ColResize.reattach){ window.ColResize.reattach(document.querySelector('#tableView table.g')); } // resize handles survive sort/search re-render (TK-10089)
   } else {
     $('#tableView').classList.add('hide'); $('#rolls').classList.remove('hide');
     const rows=filtered();
diff --git a/public/sales.html b/public/sales.html
index 1ee19ba..5cf91dd 100644
--- a/public/sales.html
+++ b/public/sales.html
@@ -244,6 +244,7 @@ function render(){
     $('#tbody').innerHTML=rows.map((r,i)=>`<tr class="srow" data-i="${i}" style="cursor:pointer">`+cols.map(c=>{const cls=(c.t==='n'||c.t==='money')?' class="n"':'';return `<td${cls}>${cell(r,c)}</td>`;}).join('')+'</tr>').join('');
     const csig=cols.map(c=>c.k).join(',');
     if(csig!==lastColSig){ lastColSig=csig; reinitResize(); }
+    else if(window.ColResize && window.ColResize.reattach){ window.ColResize.reattach(document.querySelector('#tableView table.g')); } // resize handles survive sort/search re-render (TK-10089)
   } else {
     $('#tableView').classList.add('hide'); $('#gridView').classList.remove('hide');
     const skipGrid=new Set(['address','city']);

← 9865336 col-resize: don't enhance/pin HIDDEN tables (fleet regressio  ·  back to Commercialrealestate  ·  crcp: apply fixCity to /api/fha-condos too — title-case ALL- ed3c633 →