Hello,
My search filters by drop downs and a search button to initiate the search, two of the drop downs are multipliers to the results. During the search maybe less than 2 seconds. The texts boxes in which the results are shown will flicker/shuffle through the results, and finally show the correct result. Is there a way for me skip that shuffle and flicker so after the button is initiated it only shows the correct result. Not really sure what needs to be added to my code. Any help would be greatly appreciated.
import wixData from ‘wix-data’ ;
$w.onReady( function () {
});
export function button1_click(event, $w) {
let generalFilter = wixData.filter()
.eq( “Size” , $w( ‘#dropdown1’ ).value)
.contains( “Height” , $w( ‘#dropdown2’ ).value)
.contains( “Weight” , $w( ‘#dropdown3’ ).value);
let RedFilter = generalFilter.eq( “Color” , “Red” );
let BlueFilter = generalFilter.eq( “Color” , “Blue” );
Promise.all(
[$w( ‘#dataset1’ ).setFilter(RedFilter),
$w( ‘#dataset2’ ).setFilter(BlueFilter)]
)
.then(() =>{
$w( ‘#text1’ ).expand();
$w( ‘#text2’ ).expand();
let dropdown4 = Number($w( “#dropdown4” ).value);
let dropdown5 = Number($w( “#dropdown5” ).value);
let text1 = Number ($w( “#text1” ).text);
let text2 = Number ($w( “#text2” ).text);
$w( “#text1” ).text = (dropdown4dropdown5text1).toFixed( 2 ).toString();
$w( “#text2” ).text = (dropdown4dropdown5text2).toFixed( 2 ).toString();
})
}
Thank you,