Payment Batch index accordions lazy-load via AJAX
Problem
The Payment Batch index page rendered all payment rows server-side inside each batch payment accordion on initial page load. With many batch payments containing many payments, this caused slow page loads because all payment data had to be queried and rendered upfront, even though most accordions remained collapsed.
Solution
Payment rows inside each batch payment accordion are now lazy-loaded via AJAX when an accordion is first expanded. The index page initially renders only the batch payment header rows, and clicking an accordion header triggers an AJAX request to fetch and display the payment rows for that batch.
How it works
The batch payment index page renders only the accordion header rows on initial load, with no payment rows
Clicking a batch payment accordion header fires an AJAX GET request to load the payment rows for that batch
A loading spinner is shown while the payments are being fetched
Once loaded, the payment rows are cached client-side so subsequent expand/collapse toggles are instant without additional server requests
The chevron icon animates between right-pointing (collapsed) and down-pointing (expanded) states
Clicking action buttons or dropdowns on the header row does not trigger the accordion toggle
Batch payments with no payments display a "No payments available" message
Last updated
Was this helpful?