PDA

View Full Version : Can menu be added to Miscfield-please help!!



niks86
2 Apr 2008, 10:47 PM
Hi!!
Can i add a menu to a miscfield?I tried doing it.
And i get an error:
sheet_menu.applyToMarkup is not a function

here is the code:

new Ext.form.MiscField({
region:'north',
fieldLabel: 'MiscField',
id: 'north-region',
el:'north',
width: 160,
heigth:300,
value:'<div style="float:left;"></div><div class="my-btn"></div>',
listeners: {
render: function(c) {

var sheet_menu = new Ext.menu.Menu({
id: 'mainMenu',
items: [
{
text: 'Add Sheet',
handler:addsheet
},
{
text: 'Save Sheet',
handler:savesheet
},
{
text: 'Open Sheet'

// handler:
},{
text: 'Delete Sheet'
// handler:onIClick
},{
text: 'rename Sheet'
// handler:onIClick
}
]
});





sheet_menu.applyToMarkup(c.el.child('.my-btn'));

}
}

})


Could someone please help me with it?