Hello all,
I would like to ask a question, how can I create a range slider filter in my grid gallery? I can find the one handle slider, but i want to find the range one. Thanks!
Hello all,
I would like to ask a question, how can I create a range slider filter in my grid gallery? I can find the one handle slider, but i want to find the range one. Thanks!
I may have found a way. it throws a few errors in the log, but it seems to work on my site
These are the errors:
Error: Operation (setFilter) not allowed during save
UserError: datasetApi ‘setFilter’ operation failed
Caused by DatasetError: Operation (setFilter) not allowed during save
You need to replace the sample field name Replace-with-yourCollectionFieldName
with the actual field ID from your collection.
Here is the code:
**import wixData from ‘wix-data’;
$w.onReady(function () {
$w(‘#slider1’).onChange(() => {
const sliderValue = $w(‘#slider1’).value;
// Create a filter for the number value in your collection field and set it less it to than or equal to the slider value
const filter = wixData.filter().le(‘Replace-with-yourCollectionFieldName’, sliderValue);
// Apply the filter to the dataset
$w(‘#dynamicDataset’).setFilter(filter);
});
});**