Code:
Ext.application({
name: 'Sencha',
launch: function () {
Ext.regModel('Tweet', {
fields: [{
name: 'MetricId',
type: 'int'
}, {
name: 'HostName',
type: 'string'
}, {
name: 'MetricName',
type: 'string'
}]
});
var store = new Ext.data.Store({
model: 'Tweet',
proxy: {
url: 'http://localhost:8000/Metrics/Metrics',
type: 'jsonp',
extraParams: {
page: 1,
pagesize: 10
},
reader: {
root: ''
}
}
});
store.getProxy();
//.extraParams.q = 'ipad';
store.read();
Ext.create('Ext.Container', {
fullscreen: true,
layout: 'hbox',
items: [
{
xtype: 'toolbar',
docked: 'top',
height: 50,
scrollable: {
direction: 'horizontal',
indicators: false
},
items: [
{ ui: 'back', text: 'Back' },
{ text: 'Default' },
{ ui: 'round', text: 'Round' },
{ xtype: 'spacer' },
{
xtype: 'segmentedbutton',
items: [
{ text: 'Option 1' },
{ text: 'Option 2', pressed: true },
{ text: 'Option 3' }
]
},
{ xtype: 'spacer' },
{ ui: 'action', text: 'Action' },
{ ui: 'forward', text: 'Forward' },
{
xtype: 'segmentedbutton',
allowMultiple: true,
items: [
{ text: 'Toggle 1', pressed: true },
{ text: 'Toggle 2', pressed: true },
{ text: 'Toggle 3' }
]
}
]
},
{
xtype: 'list',
disclosure: true,
onItemDisclosure: {
scope: 'test',
handler: function (record, btn, index) {
store.getProxy();
//.extraParams.q = 'ipad';
store.read();
}
},
itemSelector: '.tweet',
tpl: '<tpl for="."><div class="tweet">{MetricId} - {HostName}</div></tpl>',
store: store,
flex: 1
},
{
xtype: 'panel',
html: 'message preview',
flex: 2
}
]
});
//Ext.Viewport.add(panel);
}
});
Why I can not show the sider panel although the firebug didn't make any error........