I have added a table to my dynamic page. I want that table to be filtered using the information from a text box (which is fed data from the dynamic collection).
My code is as per below:
import wixData from ‘wix-data’;
$w.onReady( function () {
//Get records with text link to title.
$w(“#dataset1”).setFilter(wixData.filter()
.eq(‘test_clientvisits_charterer’, $w(‘#CName’).text )
);
})
The table is empty though, what am I doing wrong?
If I replace “$w(‘#CName’).text” with the actual content of the textbox, the table displays the correct data.
Ah - good for you! Don’t know why I didn’t think about the dataset.onReady() . That’s certainly the main part of the problem. If the dataset isn’t ready, then the text field hasn’t been set yet either.