I have a simple php page that contains a form and lets me read in and update a record in a database.
I am trying to enclose this is a modal popup from an Ext 3.4 application.
I am using Managed IFrame 2.1.5. I am using the example code from the MIF wiki. The code opens the MIF and displays my php file just fine.
I am trying to figure out how to close the window when I click the cancel or ok button on my form on my php page.
Here is my code that creates the MIF and opens the window. editProject is a method in my editablegrid object.
I've looked at every mif wiki and doc site that still works and I can't locate any examples or docs on how to close the window, or specifically how to access the containing window from within the iframe.
Thanks!
Lynn Kasdorf
Code:
,editProject: function() {
//this.projectForm.show(record, grid.getView().getCell(row, col), this.store);
var MIF = new Ext.ux.ManagedIFramePanel({
border: false,
bodyBorder: false,
defaultSrc:'editProject.php?projectId=' + this.projectId,
listeners:{
domready : function(frame){
var fbody = frame.getBody();
var w = Ext.getCmp('myFrameWin');
if(w && fbody){
//calc current offsets for Window body border and padding
var bHeightAdj = w.body.getHeight() - w.body.getHeight(true);
var bWidthAdj = w.body.getWidth() - w.body.getWidth(true);
//Window is rendered (has size) but invisible
w.setSize(Math.max(w.minWidth || 0, fbody.scrollWidth + w.getFrameWidth() + bWidthAdj) ,
Math.max(w.minHeight || 0, fbody.scrollHeight + w.getFrameHeight() + bHeightAdj) );
//then show it sized to frame document
w.show();
}
}
}
});
var windowFrame = new Ext.Window({
title: name,
width: 600, //give it something to start with until the frame renders
height: 400,
hideMode:'visibility',
id:'myFrameWin',
hidden : true, //wait till you know the size
title: 'Sized To Frame Document',
plain: true,
constrainHeader: true,
minimizable: true,
ddScroll: false,
border: false,
bodyBorder: false,
layout: 'fit',
plain:true,
maximizable: true,
buttonAlign:'center',
items:MIF,
modal: true
});
windowFrame.show();
}