Oh the other thing happeing with getTotalCount() of dataset,
the first result equal total item in datase
the second result (after click search button) is the equal exactly number of record in data
but the third and next time click the result of total item equal zero
Here is my code
function searchProduct () {
const filterProduct = wixData.filter().contains(‘name’,$w(‘#input1’).value) ;
let numPage ;
$w('#alert').text="Đang tìm kiếm dữ liệu"
$w('#ProductList').setFilter(filterProduct);
$w('#ProductList').refresh();
//
$w(‘#mes3’).text=$w(‘#ProductList’).getTotalCount() ;
// $w(‘#alert’).text= “Found “+ $w(‘#ProductList’).getTotalCount() +” result for keyword " +'”‘+ $w(’#input1’).value+‘"’;
$w(‘#box1’).show();
$w(‘#repeater1’).show();
$w(‘#box1’).expand();
$w(‘#box2’).collapse();
//$w(‘#pagination1’).totalPages=resultPage;
// show this value in the textbox
}
the first click: alert=total item in my data
the second click: alert= item after query (Right number)
the third click : alert=0;
How can i solve them?