:::: 개발 ::::/::: JSCRIPT :::

senchaTouch2 JSONP

nayha 2012. 5. 29. 21:53
반응형

<!DOCTYPE html>

<html>

<head>

<link href="./lib/sencha-touch.css" rel="stylesheet"/>

<script type="text/javascript" src="./lib/sencha-touch-all.js"></script>

<script type="text/javascript">


Ext.setup({

onReady : function(){

var keyword = "nayha";

var refresh = function(){

timeline.setMasked({type:'loadMask',indicator:true});

Ext.data.JsonP.request({

url : 'http://search.twitter.com/search.json',

callbackKey : 'callback',

params : {

q: keyword,

rpp : 30

},

success : function(data){

timeline.setData(data.results);

},

callback : function(){

timeline.unmask();

}

})

};

var overlay = new Ext.Panel({

modal : true, hideOnMaskTap :true,

width : 300, height: 200,

html : 'overLAY'

});

var timeline = new Ext.Panel({

fullscreen : true,

scrollable : 'vertical',

tpl : [

      '<tpl for =".">',

      '<div class="tweet">',

      '<div class="avatar">',

      '<img src="{profile_image_url}" /></div>',

      '<div class="tweet-content">',

      '<h2>{from_user}</h2>',

      '<p>{text}</p>',

      '</div>',

      '</div>',

      '</tpl>'

      ],

      

items : [{

xtype : 'toolbar',

title : 'Twt Search',

dock : 'top',

ui : 'light',

align : 'right',

items:[{

iconCls : 'refresh',

iconMask : true,

handler : refresh

},

{

iconCls : 'search',

iconMask : true,

text :'search', 

handler : function(btn,evt){

overlay.showBy(btn);

}}

]

},


{

dock :'top',

sytle : 'background : #555',

html : 'keyword' + keyword

}]       

 });

refresh();

}

});

</script>

</head>

<body>


</body>

</html>

반응형