I have a database collection and I have an option for user to filter the collection using a filter button and this code in the click event of the filter button : $w("#datasetname").setFilter(wixData.filter().eq("parameter", parameter_value));
But when I click on the filter button, the filtering option is working fine but other database properties like $w("#dataset1").getTotalCount(); is giving the total count of the database before filtering operation. And if i click on the filtering button again, $w("#dataset1").getTotalCount(); gives the correct value that corresponds to the number of elements after filtering operation.
That means the user need to click on the filter button 2 times to get the desired properties of my database . Is there any way to solve this issue so that as soon as the filter button is clicked, the database table is updated and the properties of the filtering operation are accessible? Thanks