Hi Tal,
Thanks for your response and for your patience.
I still cant get it to work, there are no error messages showing when I run the code although I’m still not getting any results and the table remains blank. I was wondering if you were able to help we figure out where I am going wrong?
Am I missing anything?
I have named my elements as follows:-
Search bar = ’ #input1 ’
Location drop down = ’ #location1 ’
Classification drop down = ’ #classification ’
Table = ’ #table1 ’
Dataset = ’ #dataset2 ’
Database = ‘careers’
This is my code so far:
let originalRows = ;
$w.onReady(function () {
$w(‘#dataset1’).onReady(() => {
originalRows = $w(‘#table1’).rows;
});
});
function filterTable() {
let newRows = originalRows;
const field = $w(‘#location1’).value;
const location = $w(‘#classification’).value;
if (location && location !== ‘location’) {
newRows = newRows.filter(item => item.positionLocation === location);
}
if (field && field !== ‘category’) {
newRows = newRows.filter(item => item.Field === field);
}
$w('#table1').rows = newRows;
}
export function location1_change(event, $w) {
filterTable();
}
export function classification_change(event, $w) {
filterTable();
}