Hello, I have a JavaScript that I would like to run to account the number of rows that appears after filtering. The filtering script is working, but when I run the script to count the row count it returns [object Object], but when I run the script directly in the browser, it correctly returns 4. Does anyone have any insight for what I could be doing wrong? Here's the script:
function ExecuteScript() {var rowCount;
// Define a function to count rows
function countRows(container) {
// Initialize a counter
rowCount = 0;
// Check if the container exists
if (container) {
// Find all elements with role="row" within the container
var rows = container.querySelectorAll('[role="row"]');
// Count the number of elements found
rowCount = rows.length;
}
// Return the count
return rowCount;
}
// Call the countRows function with the container variable as an argument to update the global variable rowCount
countRows(document.querySelector('.x-grid-item-container'));
return rowCount;}
ExecuteScript();