Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions renderer/js/events/connections/events-get-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3440,6 +3440,9 @@ $(document).on('getConnections refreshConnections', function(e, passedData) {
})
} catch (e) {}

// Update the pagination counter's partial/complete state for this chunk before it redraws
tableObj.hasMorePending = isOutputWithPaging && !isOutputCompleted

tableObj.blockRedraw()
tableObj.clearSort()
tableObj.addData(newPage.json, false).then(() => {
Expand Down Expand Up @@ -3730,6 +3733,9 @@ $(document).on('getConnections refreshConnections', function(e, passedData) {
// Hold the created object
tabulatorObject = _tabulatorObject

// Flag the pagination counter as partial while the server still has more rows to fetch
tabulatorObject.hasMorePending = isOutputWithPaging && !isOutputCompleted

tabulatorObject.selectorTableInfo = selectorTableInfo

let paginator = outputElement.find('div.sub-output-content').find('span.tabulator-paginator')
Expand Down
22 changes: 21 additions & 1 deletion renderer/js/utils/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,27 @@ let convertTableToTabulator = (json, container, paginationSize = 100, pagination
// selectableRowsRangeMode: 'click',
virtualDom: true,
paginationSizeSelector: paginationSizeSelectorEnabled ? [5, 10, 20, 40, 60, 80, 100] : false,
paginationCounter: 'rows',
/**
* Custom counter instead of the built-in `rows` preset
*
* The built-in counter only ever knows about rows already loaded into
* the table, so a server-paged query looks "complete" after every
* chunk. `this.table.hasMorePending` is set by the caller (see
* `events-get-connections.js`) whenever the server still has more
* rows to fetch, so the total shown here can be marked as partial
* instead of misrepresented as final.
*/
paginationCounter: function(pageSize, currentRow, currentPage, totalRows, totalPages) {
let hasMorePending = this.table.hasMorePending === true,
lastRow = totalRows > 0 ? Math.min(currentRow + pageSize - 1, totalRows) : 0,
el = document.createElement('span')

el.textContent = totalRows > 0 ?
`Showing ${currentRow}-${lastRow} of ${totalRows}${hasMorePending ? '+' : ''} rows${hasMorePending ? ' (more available)' : ''}` :
'No rows'

return el
},
rowFormatter: function(row) {
/**
* Format some data in the rows
Expand Down
Loading