This code is nice, but it isn’t useful for that I want to do
here is the problem:
{ view: 'list',
id: 'lista',
type : {
css : "frame",
height : "auto",
width : "auto"
},
scroll: true,
datatype: 'json',
select : true,
template : '<table>'
+'<tbody>'
+'<tr><td><b>#name#</b></td></tr>'
+'<tr><td style="font-size:80%;">#address#</td></tr>'
+'</tbody>'
+'</table>'
+'<table>'
+'<tbody>'
+'<tr>'
+'<tpl if=#turismo#>'
+'<td style="width:40px"><img src="images/turismo.gif"></td>'
+'</tpl>'
+'<tpl if=#cuatroxcuatro#>'
+'<td style="width:40px"><img src="images/4x4.gif"></td>'
+'</tpl>'
+'<tpl if=#suv#>'
+'<td style="width:40px"><img src="images/suv.gif"></td>'
+'</tpl>'
+'<tpl if=#furgo#>'
+'<td style="width:40px"><img src="images/lighttruck.gif"></td>'
+'</tpl>'
+'</tr>'
+'</tbody>'
+'</table>' ,
url: 'resources/data/talleres.json',
},
and here it is the JSON where I am taking the data:
[code][
{
“id”: 0,
“name”: “XXXXXXXX”,
“lat”: “42.77”,
“lon”: “-7.68”,
“address”: “XXXXXX”,
“turismo”: true,
“cuatroxcuatro”: true,
“suv”: true,
“furgo”: true
},
{
"id": 1,
"name": "XXXXXXX",
"lat": "40.34",
"lon": "-3.83",
"address": "XXXXXXXX",
"turismo": true,
"cuatroxcuatro": true,
"suv": true,
"furgo": true,
"tfno": "666666666"
}
][/code]
So the problem is that I want to show images depending if the fields are defined, (cuatroxcuatro, suv, furgo & turismo), so I need some like the line in the template.
Ask for more info if it’s needed
Thanks so much