Fix for index page badge (#5115)

- If table was not paginated, totalRows did not exist
- Handle this case by looking at length of actual data
This commit is contained in:
Oliver 2023-06-28 15:22:08 +10:00 committed by GitHub
parent 940fa74365
commit 53e120cdb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,11 @@ function addHeaderAction(label, title, icon, options) {
let count = options.totalRows;
if (count == undefined || count == null) {
let data = $(table_name).bootstrapTable('getData');
count = data.length;
}
let badge = $(`#sidebar-badge-${label}`);
badge.html(count);