I am trying to implement buttons in a pop-up window with Sencha Touch 2. How do the buttons work? I would like one button to close the window and another to call the doSomething function.
function foo(){
Ext.Viewport.add({
xtype: 'panel',
scrollable: true,
centered: true,
width: 400,
height: 300,
items:[
{
docked: 'bottom',
xtype: 'titlebar',
items:[
{
xtype: 'button',
ui: 'normal',
text: 'Do Something',
go: 'testsecond'
},
{
xtype: 'button',
ui: 'normal',
text: 'Close',
go: 'testsecond',
},
]
},
]
});//Ext.Viewport.add
}
function doSomething() {
console.log('hi');
}