Incremental Scrolling Table - Displaying Record Count

Hello,

We have a number of forms that we want to display the number of records found at the bottom. When the number of records (filtered) is under the foundst.pkChunkSize, the count displays correctly. My issue is when there are more records than the current foundset.pkChunkSize, the count displays 200 (foundset.pkChunkSize value). When I scroll to the bottom and the foundset fetches more, the count doesn’t change and I can’t find any events on the table (servoyextra-table) or the foundset to trigger updating the count.

Has anyone else found a workaround or solution to this type of issue?

Thanks,
Louis

Hi, Louis.

Have a look at the following code (call using onRecordSelection of the various forms):

function displayRecordStatus( formName )
{
    if ( !formName ) return ''
    
    
    // Get the number values.
    
    var currentRecordIndex = forms[ formName ].foundset.getSelectedIndex()
    
    var numberOfRecordsInFoundset = forms[ formName ].foundset.getSize()
    
    var totalRecordsInTable = databaseManager.getFoundSetCount( forms[ formName ].foundset )
    
    
    // String format the numbers.
    
    var sIndex = utils.numberFormat( currentRecordIndex, '#,###' )
    
    var sFoundset = utils.numberFormat( numberOfRecordsInFoundset, '#,###' )

    var sTotal = utils.numberFormat( totalRecordsInTable, '#,###' )

    
    // Return the formatted string.
    
    return 'Item ' + sIndex + ' of ' + sFoundset + ' (out of ' + sTotal + ')'
}

Thanks Kim, this worked great!