I have a drop-down element that displays 4 categories. I need “Select Category” to display at the top of the 4 categories, and when chosen, all of the category items will redisplay in the associated repeater. The code below is working on another website but not on the site I’m currently working on. What could be the problem?
function loadjobs () {
wixData . query ( ‘jobs’ )
. limit ( 100 )
. ascending ( “category” )
. distinct ( “category” )
. then ( results => {
let distinctList = buildOptions ( results . items );
// unshift() is like push(), but it prepends an item at the beginning of an array
distinctList . unshift ({ “value” : ‘null’ , “label” : ‘Select Category’ });
// Call the function that builds the options list from the unique titles
$w ( “#iCategory” ). options = distinctList ;
});
}