If the user clicks on a button in one repeater, it will filter the content of the other if they are both connected to different data bases
Hello flamanyoman,
take a look here…
https://www.wix.com/corvid/reference/$w/repeater/introduction
You will need to loop trough the first repeater to find the value for filtering process in dataset-2.
After filtering process in your second database, you just simply push the result to your second repeater.
How to loop trough repeater?
$w("#myRepeater").forEachItem( ($item, itemData, index) => {
2 let repeatedElement = $item("#repeatedElement");
3 let nonRepeatedElement = $w("#nonRepeatedElement");
4 let itemDataValue = itemData.someProperty;
5 let isEvenItem = index % 2 === 0;
6} );
Copy Code
1$w.onReady(function () {
2 $w("#myDataset").onReady( () => {
3 $w("#myRepeater").forEachItem( ($item, itemData, index) => {
4 if(itemData.boolField){
5 $item("#myText").text = "Yes Ma'am!";
6 }
7 else {
8 $item("#myText").text = "No way!";
9 }
10 } );
11 } );
12} );
Or some code of my own…
$w.onReady(function () {
$w("#dataset8").onReady( () => {
$w("#repeater1").forEachItem( ($item, itemData, index) => {
$item("#BTNedit").onClick((event) => {
console.log("you clicked " + itemData._id)
$w("#dataset8").getItems(index, 1)
.then( (result) => {
let items = result.items;
let totalCount = result.totalCount;
let offset = result.offset;
console.log(items)
})
.catch( (err) => {
let errMsg = err.message;
let errCode = err.code;
});
});
});
});
});
These are all just examples, so you will have to modify code for your own project.