var myTpl = new Ext.XTemplate (
'<tpl for=".">',
'<div class = "tweets">',
'<div class = "profile_image"><img src="http://a3.twimg.com/profile_images/494641058/camara_de_diputadosa_normal.jpg"></img></div>',
'<div class = "tweet_created"><p>{created_at}</p></div>',
'<div class = "tweet_text"><p>{text}</p></div>',
'<div class = "tweet_url"><a href = "http://www.diputadospri.org.mx" ><p>http://www.diputadospri.org.mx</p></a></div>',
'</div>',
'</tpl>'
);
////modelo de datos////
twr = Ext.regModel( 'Tweet',{
fields: [ {name:'text'},{name:'user.profile_image_url'},{name:'created_at'},{name:'user.url'}]
});
////store donde se almacenara y seleccionara la informacion////
var store = new Ext.data.Store({
model: 'Tweet',
storeId:'tweet',
proxy: {
type: 'scripttag',
url : 'http://twitter.com/statuses/user_timeline/diputadospri.json?&count=10',
reader: {
type: 'json',
}
}
});
store.load();
console.log(store);
var twitterPanel = new Ext.Panel({
id: 'twitterPanel',
items: new Ext.DataView({
tpl: myTpl,
store: store,
autoHeight:true,
multiSelect: true,
itemSelector:'div.tweets',
emptyText: 'No images to display'
})
});
Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
onReady: function() {
var mainPanel = new Ext.Panel({
fullscreen:true,
id:'mainPanel',
tpl:myTpl,
maxWidth:450,
maxHeight:500,
minHeight:150,
minWidth:200,
scroll: 'vertical',
items: [twitterPanel]
});
}
});
It looks like you're new here. If you want to get involved, click one of these buttons!
The content of this site is copyrighted by Quizzpot.com, it is prohibited to publish our tutorials on other blogs, magazines or any other media without prior permission.
Copyright © 2012 Quizzpot.
Our visitors are mostly developers and Web designers, advertise with us, you only need to contact us .