THIS is how my code looks
SOMEONE PLEASE HELP I AM NOOB HERE
import wixData from 'wix-data';
export function Reset_click(event) {
$w('#dropdown11').value = "GORILLA GLASS";
$w('#dropdown7').value = "USAGE";
$w('#dropdown8').value = "PRICE RANGE";
$w('#dropdown9').value = "SCREEN SIZE";
$w('#dropdown10').value = "STORAGE";
$w('#dropdown12').value = "DEVICE TYPE";
$w('#dropdown13').value = "CHARGER TYPE";
$w('#dropdown15').value = "SCREEN TYPE";
$w('#dropdown4').value = "BRAND";
$w('#dropdown5').value = "RAM";
$w('#dropdown6').value = "PROCESSOR";
$w('#dataset2').setFilter(wixData.filter());
//Add your code for this event here:
}
Hi Madhukar Yadav,
i’m going to try to help you.
so it seemslike you have a bunch of dropdowns.
what exactly are you trying to do here?
couse it seems like you try to add a string to a dropdown the wrong way.
you can’t use .value like that
this:
$w(“#dropdown4”).value
is the selected value from your dropdown4
if you would add a button with a click event and add this in it :
console.log($w(“#dropdown4”).value
you will see that depending on what you select in dropdown4
the log will change when you press the button.
kristof.
so i was trying to reset the values of the dropdowns again.The clear all button code i have shown you ,but after reset my filter is not working before clicking the button filter works fine
to reset a dropdown use this
$w(“#dropdown1”).selectedIndex = undefined
however the dropdown border wel be red when making it undefined but the placeholder text gets back in place
kristof.
but the repeater i am using which is connected to the dataset is not filtering again after this
$w ( “#myDataset” ). setFilter ( wixData . filter () );
i used this the repeater data got reset but filter is not working
$w ( " #myDataset " ). setFilter ( wixData . filter ().contains(“brand”,“”));
does this work?
@ymadhukar143
Can you make me a contibutor?
Kristof.print3d@gmail.com
I will take a look
And post back if i find the error or not.
You can always make a duplicate from your website to make sure nothing happends with the real one
@volkaertskristof i have sent you a invite to my duplicate website
Go on the smartphone page .
by the way thanks for the help man
@ymadhukar143
i edited it and it works as i told.
you came in so i saved it,
go out of it without saving! and reopen it to try
also give the website a bit of time to load it is a bit slow.
(wich is normal in editor/preview)
kristof.
@volkaertskristof man it works for the first time when i try to filter and when i reset it,nothing happpens all the elements are shown
@ymadhukar143
oow yea i see what you mean.
gona take another look
It should be oke now.
i added $w(“#dataset2”).refresh
instead of the filter
Kristof.
It should be working now.
changed evrything to selectedIndex = undefined
removed the filter and added
$w(" #dataset2 ").refresh
working code :
import wixData from ‘wix-data’ ;
export function Reset_click ( event ) {
$w ( ‘#dropdown11’ ). selectedindex= undefined ;
$w ( ‘#dropdown7’ ). selectedindex = undefined ;
$w ( ‘#dropdown8’ ). selectedindex = undefined ;
$w ( ‘#dropdown9’ ). selectedindex = undefined ;
$w ( ‘#dropdown10’ ). selectedindex = undefined ;
$w ( ‘#dropdown12’ ). selectedindex = undefined ;
$w ( ‘#dropdown13’ ). selectedindex = undefined ;
$w ( ‘#dropdown15’ ). selectedindex = undefined ;
$w ( ‘#dropdown4’ ). selectedindex = undefined ;
$w ( ‘#dropdown5’ ). selectedindex = undefined ;
$w ( ‘#dropdown6’ ). selectedindex = undefined ;
$w ( ‘#dataset2’ ). refresh()
//Add your code for this event here:
}
kristof.
@ymadhukar143
yea you can check it.
@volkaertskristof ya man it worked a big thanks to you man.
@ymadhukar143
no problem, happy i could help