Hi,
I have created a calculated field in my collection. I did this using a Hook (basckend) and it works properly as I am able to see the calculated field in my Collection.
I have a Repeater on my site that display the content of my Collection that also has a search field that search a specific column for specific data. The search works fine when I am using any fields other than the calculated field.
How can I use it in my search?
Thank you
Pierre Lacasse
–Here is the code for my search inputbox.
export function input1_keyPress(event, $w) {
filter($w(‘#input1’).value);
}
console.log (filter)
function filter(title) {
$w(‘#dataset1’).setFilter( wixData.filter().contains(‘nom2’, title));
nom2 is my calculated field keyword. If I use nomFamille (not calculated) the search works properly
–data.js code (backend, hook)
export function ListeMembres_afterQuery(item, context) {
item.nom2 = item.prenom + " " + item.nomFamille;
return item;
}
This create the calculated column in my ListeMembres collection