SmartClient Version: v13.1p_2025-12-31/AllModules Development Only (built 2025-12-31)
Hi, I was trying to use the imageWidth and imageHeight properties on a field of a TileGrid, using the notation that allows setting a string representing the name of a field which, in the record, contains the actual size:
Unfortunately, I noticed that this does not work, since I cannot find the dimensions in the <img> tag, even though SimpleTile is based on a DetailViewer whose fields should support this behaviour.
However, I then noticed that if I use numeric values directly for imageWidth and imageHeight, those values are correctly applied to the <img> tag:
I therefore wonder whether this is something that is supposed to work (and maybe I need a different setting), or whether it is not supported and I should instead customize the Tile.
Hi, I was trying to use the imageWidth and imageHeight properties on a field of a TileGrid, using the notation that allows setting a string representing the name of a field which, in the record, contains the actual size:
Code:
animalData = [
{
picture:"Elephant.jpg",
imageWidth:150,
imageHeight:113,
commonName:"Elephant (African)",
information:"The African Elephant is the largest of all land animals and also has the biggest brain of any land animal. Both males and females have ivory tusks. Elephants are also wonderful swimmers. Man is the only real enemy of the elephant. Man threatens the elephant by killing it for its tusks and by destroying its habitat.",
lifeSpan:60,
scientificName:"Loxodonta africana",
diet:"Herbivore",
status:"Threatened"
}
];
Code:
isc.TileGrid.create({
tileWidth:150,
tileHeight:190,
height:"100%",
width:"100%",
showAllRecords:true,
data:animalData,
fields: [
{name:"picture", type:"image", imageURLPrefix:"../inlineExamples/tiles/images/", imageWidth:"imageWidth", imageHeight:"imageHeight"},
{name:"commonName"},
{name:"status"}
]
});
However, I then noticed that if I use numeric values directly for imageWidth and imageHeight, those values are correctly applied to the <img> tag:
Code:
isc.TileGrid.create({
tileWidth:150,
tileHeight:190,
height:"100%",
width:"100%",
showAllRecords:true,
data:animalData,
fields: [
{name:"picture", type:"image", imageURLPrefix:"../inlineExamples/tiles/images/", imageWidth:150, imageHeight:113},
{name:"commonName"},
{name:"status"}
]
});
Comment