Hi i wonder if anyone could help
I have this store that cover that references a store called stored
[
Code:
] var cover = Ext.create('Ext.ux.Cover', { itemCls: 'my-cover-item',
//These are just for demo purposes.
height: (Ext.os.deviceType !== 'Phone')? 400: undefined,
width: (Ext.os.deviceType !== 'Phone')? 800: undefined,
//end-demo
itemTpl : [
'<div>',
'<div class="company">{artist} </div>',
'<div class="image"><tpl if="image"><img src="{image}" ></tpl></div>',
'</div>'
],
store : stored,
selectedIndex: 2,
listeners:{
itemdoubletap: function(cover, idx){ //#2
console.log('itemdbltap', arguments);
if(cover.activeItem === idx){
//do something here
}
},
itemtap: function(cover, idx){ //#1
console.log('itemtap', arguments);
if(cover.activeItem !== idx){
cover.setActiveItem(idx);
}
},
scope: this
}
});[
]
Which has this model
[
Code:
] Ext.regModel('Flow', { fields : [ 'id', 'artist', 'name', 'icon', 'image', 'spotifyUrl', 'review', 'homeURL', 'homeUrlIcon' ]
});
[
]
if i use the following store the cover flow looks great
[
Code:
] var storedx = new Ext.data.JsonStore({ model : 'Flow',
data : [ {
image : 'http://productshopnyc.com/htdocs/2007_ALBUMS_OF_THE_YEAR.JPG'
}, {
image : 'http://productshopnyc.com/htdocs/2007_ALBUMS_OF_THE_YEAR.JPG'
} // Check here you had an extra comma (,)
]
});[
]
how ever if i use a controller call to server to get data
[
Code:
] var stored = new Ext.data.Store({
model: 'Flow',
proxy: new Ext.data.HttpProxy({
type: 'ajax',
url : 'http://localhost:8080/spotify-portal/album/listJSON',
reader: {
type: 'json'
}
}),
autoLoad: true
});[
]
It appears the if statement in this tag is always false
[
Code:
]'<div class="image"><tpl if="image"><img src="{image}" ></tpl></div>',[
]
Heres the json from server
[
Code:
][{artist:"batman1",image : "http://img.uvumi.com/photos/2241/mini/album-cover-small2-1.jpg"},{artist:"batman2",image : "http://img.uvumi.com/photos/2241/mini/album-cover-small2-1.jpg"}][
]
which appears to be ok as if i use the image div without the if it displays but formatting all screwy.
Any pointers