PDA

View Full Version : How to insert image into NestedList's item?



Another84
5 Sep 2011, 4:39 AM
Hi all! How to insert image into NestedList's item?


I did that way:


json:



"items": [
{
"model": "...",
"text": "...",
"info": "...",
"img": "album-ag.jpg",
"leaf": false,


js code:



'<tpl if="model === \'Serial\'">'+
'<div class="item-overview">' +
'<img class="mv-img" src="{[values.img]}" width="156" height="156" alt="">' +
'<div class="mv-h">{[values.text]}</div>' +
'<div class="mv-descr">{[values.info]}</div>' +
'</div>' +
'</tpl>' +




but it doesn't work.
Warning in console says: "Resource interpreted as image but transferred with MIME type text/html."

Please help! :)

Another84
5 Sep 2011, 11:18 PM
Sorry, it was my mistake.
Just need to add string into model:


Ext.regModel('ListItemMusic', {
fields: [
... ,
{name: 'img', type: 'string'},
]
});