I am new to Ext JS4. What i would like to achieve is to open a file dialog from a menu.
I know if i create it as a button as shown below and add it into the menu as an item it will work. But i do not wish to add it as a button in the menu.
var importButton = Ext.create('Ext.form.file.File', {
buttonOnly: true,
buttonText: 'Import',
hideLabel: true,
listeners: {
'change': function(fb, v){
onImportButtonClick(fb.getValue());
}
}
});
The below is the code that i have.
var fileMenu = Ext.create('Ext.menu.Menu', {
width: 125,
maxWidth: 125,
padding: 0,
plain: false,
items: {
text: 'Import',
id: 'import',
handler: function(){
//Code to open up the file dialog
}
}
});
Hope someone out there could guide me on how to fill out the commented part. Many thanks in advanced.