macydj
Posts: 0
Joined: Tue Jun 02, 2015 6:08 pm

Javascript to hide entire item[i] from results?

I'm working with an RSS feed. I would like to hide a feed item based on a field in the feed. Example: If the Title of the Channel (source of the feed) equals BlogXYZ, then don't return that item.

I understand how to evaluation a individual field value and hide that. But is there a way I can evaluate it at the item level.

What script would I place in the JS at the point where I map item rss item to my container?

macydj
Posts: 0
Joined: Tue Jun 02, 2015 6:08 pm

Javascript to hide entire item[i] from results?

Thanks Sergiy, but I need more specific syntax. I do understand how to hide an individual value with JS when it is mapped to a page component. What I'm wondering is what is the syntax to hide an entire list item based on the value of one it's child items.

So when I map item to the container, I'd like to add JS that says:
If element XYZ of item = 'something', then hide the entire item.

How can the elements of an item be addressed?
This doesn't work (I'm just guessing here). 'something' represents the array item I'm trying to evaluate.

if ( item[something].value == 'xyz' ){
perform some script here
}

Return to “Issues”