Page 1 of 1

Incremental Scrolling Table - Displaying Record Count

PostPosted: Thu Aug 01, 2019 5:09 pm
by Louis.Winter
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

Re: Incremental Scrolling Table - Displaying Record Count

PostPosted: Thu Aug 01, 2019 6:24 pm
by kwpsd
Hi, Louis.

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

Code: Select all
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 + ')'
}

Re: Incremental Scrolling Table - Displaying Record Count

PostPosted: Thu Aug 01, 2019 8:54 pm
by Louis.Winter
Thanks Kim, this worked great!