PDA

View Full Version : Context menu within an IFrame window



kisundar
9 Nov 2012, 12:17 PM
I have a View created





Ext.define('Status.view.user.SummaryView',
{
//extend: 'Ext.view.View',
extend: 'Ext.panel.Panel',
alias: 'widget.buildsummaryview',
autoScroll: false,
tpl: new Ext.XTemplate(
'<tpl for=".">',
'<h1><center><b>Summary<br></b></center></h1>',
'<iframe id="frame1" class="thumb-wrap" seamless="seamless" frameborder="1" style="width:100%; height:100%;" src="{testurl}"></iframe>',
'</tpl>'
),
itemSelector: 'div.thumb-wrap',
emptyText: 'No Summary Data available'
});

Here testurl is an external url which gets rendered in the view. Now I want to attach a Ext context menu within the iframe. I am not sure how to do this.



var context = new Ext.menu.Menu({
items: [
{
text: 'I like Ext',
checked: true
}, '-', {
text: 'Custom context menu'
}
]
});

mitchellsimoens
14 Nov 2012, 10:31 AM
The issue is the iframe is an actual different document and Ext JS is not loaded within the iframe.

kisundar
14 Nov 2012, 11:50 AM
my reuirement is that I need a context menu in my Ext Panel

I am using someething like this




xtype: 'panel',
autoLoad: {
url: <some url which renders a html>
}




Now I want to have a context menu rendered for this url page contents. Is there a way i can achieve this. Kindly advice. Is there a sample code for the same