Jason Baird
Posts: 0
Joined: Tue Nov 26, 2013 11:38 pm

Hidding when mapping

My data is returned like below and the array is mapped to a grid in this way. How would I hide the entire row if nutrient_name = "Calcium" for example. I know how to hide the labels they are mapped to based on values. But how the entire row?

"nutrients":[
{
"nutrient_name":"Calcium",
"nutrient_value":"",
"nutrient_uom":"mg",
"nutrient_fe_level":"4"
},
{
"nutrient_name":"Calories",
"nutrient_value":"150.0",
"nutrient_uom":"Cal",
"nutrient_fe_level":"6"
},
{
"nutrient_name":"Calories from Fat",
"nutrient_value":"40.0",
"nutrient_uom":"Cal",
"nutrient_fe_level":"6"
}
]

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Hidding when mapping

Hello Jason,

You may add the js code to the mapping in the grid and in this code you may check the value of value and hide the entire line (variable element in the mapping in this case will refer to the entire table created by mapping ).
Or you may add the js code to the mapping of parameter nutrient_name and in this code when it executes you may hide not the element itself but find appropriate parent element (tr or table) http://api.jquery.com/closest/

Return to “Issues”