Thanks for the reply! I tried it out, unfortunately doesn't work, if this helps,
this is my 'NewsContainer' which is my navigation view which contains 'New' which is where my list is, its a carousel.
NewsContainer:
Code:
Ext.define('demo.view.NewsContainer',{
extend:'Ext.navigation.View',
xtype:'newscontainer',
requires: [
'demo.view.New',
'demo.view.Mapo'
],
config:{
title:'Home',
iconCls:'home',
cls: 'home',
items:[
{
itemCls: 'feed',
style: 'background-color: Transparent;',
xtype:'new'
}
]
}
});
New.js (Carousel) which contains 'list' which is the first item of my carousel.
Code:
Ext.define('demo.view.New',{
extend:'Ext.Carousel',
xtype:'new',
requires:['Ext.plugin.PullRefresh'],
config:{
title:'Traffic Watch',
iconCls:'home',
layout:'fit',
items:[
{
plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Pull down to refresh!'
}
],
itemCls:'xmlfeed',
xtype:'list',
store:'news',
html:['<center><b><font face= "Dosis" size="5" color="blue">LTA Newsfeed</font></b></center>'].join(""),
style: 'background-color: Transparent;',
itemTpl: new Ext.XTemplate(
'<div style="float-left; width:60px;">',
'</div>',
'<div style="margin-left: 40px;">',
' <img src={[this.getImagePath(values)]} /><br><br><h1>{Message}</h1>',
'</div>'
, {
getImagePath: function (values) {
if (values.Message.indexOf("Roadworks") != -1) {
return 'resources/images/roadworks.png';
}
else if (values.Message.indexOf("Accident") != -1) {
return 'resources/images/accident.png';
}
else if (values.Message.indexOf("breakdown") != -1) {
return 'resources/images/breakdown.png';
}
else {
return 'resources/images/heavytraffic.png';
}
}
}
)
},
{
plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Pull down to refresh!'
}
],
itemCls:'userdisplay',
xtype: 'list',
itemId: 'DisplayList',
style: 'background-color: Transparent;',
html:['<center><b><font face= "Dosis" size="5" color="blue">User Newsfeed</font></b></center>'].join(""),
itemTpl: [
'<div style="float-left; width:60px;">',
'</div>',,
'<div style="margin-left: 62px;">',
' <h1><b>@{username}</b></h1><br><h2>{description}<br><br><br>{time}</h2>',
'</div>'
],
store: 'Displays'
}
]
}
});
Thank you for all your help, been struggling with this school assignment for a while now.