-
24 Nov 2010 4:55 AM #761
Does ExtJs or ManagedIframe panel checks for "id duplication" before assigning the auto-generated id to an element? Or they checks only in their counter?
-
24 Nov 2010 6:17 AM #762
MIF.get uses the same strategy as Ext.get, in that it maintains seperate Element caches for each frame document context it manages.
However, scanning the entire document for instances of duplication (getElementsByTagname) each time Ext.get is called, would be prohibitively slow.
The internal counter is only used when an Element does not yet have an id assigned, and an attempt at a unique value is required. Ext and MIF are written such that if an Element is found within the Element caches with the same id, the last Element referenced by that ID is asserted in the cache (replacing the previous reference).
Hope that explains it..."be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
24 Nov 2010 6:35 PM #763
I have a simple doubt, say in a document I assigned myself an id like "ext-gen26" to an element(just for an example). Does there are chances Ext or MIF uses the same id for other element?
-
17 Dec 2010 8:25 AM #764
Ext.ux.ManagedIFrame.Panel callback fails
Ext.ux.ManagedIFrame.Panel callback fails
Hello,
I am using ManagedIFrame to house a PDF but I am having difficulties with callbacks.
This is my code:
create_pdf.php basically creates a PDF document.Code:var panelPDF = new Ext.ux.ManagedIFrame.Panel( { frameCfg: { id : 'pdfFrame' }, tbar: [ { text: 'Create PDF', handler: function(button) { var waitMask = new Ext.LoadMask(panelPDF.el, {msg:'Please wait creating PDF....'}); waitMask.show(); Ext.Ajax.request( { url: 'create_pdf.php', method: 'GET', params: { text: 'HELLO WORLD' }, success: function(response) { var jsonLocation = eval( '(' + response.responseText + ')'); panelPDF.submitAsTarget( { url: "showpdf.php", method: 'POST', params: { file: jsonLocation.document_location }, callback: function(frame) { waitMask.hide(); }, scope: this, }); }, failure: function ( result, request) { Ext.MessageBox.alert('Error', 'There was an error with your request.'); waitMask.hide(); } }); } } ] });
showpdf.php is the php script from "Doug's Demo Desk for Ext 3.2.2" MIF PDF example which loads the PDF file.
The PDF document loads fine but the callback is never called.
If I request a html page instead of PDF it works fine.
I have tried using load instead of submitAsTarget and that doesn't even request showpdf.php.
panelPDF is inside a tabpabel by the way.
I'm using EXTJS 3.3.1.
Any advise would be great
Thanks
-
17 Dec 2010 8:56 AM #765
Ext.ux.ManagedIFrame.Panel callback fails
Ext.ux.ManagedIFrame.Panel callback fails
I am using ManagedIFrame to house a PDF but I am having difficulties with callbacks.
This is my code:
create_pdf.php basically creates a PDF document.Code:var panelPDF = new Ext.ux.ManagedIFrame.Panel( { frameCfg: { id : 'pdfFrame' }, tbar: [ { text: 'Create PDF', handler: function(button) { var waitMask = new Ext.LoadMask(panelPDF.el, {msg:'Please wait creating PDF....'}); waitMask.show(); Ext.Ajax.request( { url: 'create_pdf.php', method: 'GET', params: { text: 'HELLO WORLD' }, success: function(response) { var jsonLocation = eval( '(' + response.responseText + ')'); panelPDF.submitAsTarget( { url: "showpdf.php", method: 'POST', params: { file: jsonLocation.document_location }, callback: function(frame) { waitMask.hide(); }, scope: this, }); }, failure: function ( result, request) { Ext.MessageBox.alert('Error', 'There was an error with your request.'); waitMask.hide(); } }); } } ] });
showpdf.php is the php script from "Doug's Demo Desk for Ext 3.2.2" MIF PDF example which loads the PDF file.
The PDF document loads fine but the callback is never called.
If I request a html page instead of PDF it works fine.
I have tried using load instead of submitAsTarget and that doesn't even request showpdf.php.
panelPDF is inside a tabpabel by the way.
I'm using ExtJS 3.3.1.
Any advise would be great
Thanks
-
21 Dec 2010 3:16 PM #766
@chu_man_fu
What browser is your test based upon?
MIF has it's own masking agent/methods. Try:
Code:var panelPDF = new Ext.ux.ManagedIFrame.Panel( loadMask : true, { frameCfg: { id : 'pdfFrame' }, tbar: [ { text: 'Create PDF', handler: function(button) { panelPDF.showMask('Please wait creating PDF....'); Ext.Ajax.request( { url: 'create_pdf.php', method: 'GET', params: { text: 'HELLO WORLD' }, success: function(response) { var jsonLocation = eval( '(' + response.responseText + ')'); panelPDF.submitAsTarget( { url: "showpdf.php", method: 'POST', params: { file: jsonLocation.document_location }, callback: function(frame) { console.log(arguments); //Does this happen? panelPDF.hideMask(); }, scope: this, }); }, failure: function ( result, request) { Ext.MessageBox.alert('Error', 'There was an error with your request.'); waitMask.hide(); } }); } } ] });"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
22 Dec 2010 1:59 AM #767
I am using Firefox 3.6.13.
I have change my code to:
and get the following error:Code:var panelPDF = new Ext.ux.ManagedIFrame.Panel( loadMask : true, {
Code:missing ) after argument list loadMask : true,
I guess "loadMask: true" should be inside the config JSON?
I have moved it there and made the other changes and get the following error:
Also, the console log in the callback is never called but if I change showpdf.php to return some html the callback is called.Code:panelPDF.showMask is not a function panelPDF.showMask('Please wait creating PDF....');
-
22 Dec 2010 6:39 AM #768
Problem Solved
Problem Solved
I have now solved this issue.
To get showMask to work I had to reference the frame rather than the Ext.ux.ManagedIFrame.Panel object.:
Why is this?Code:frameCfg: { id : 'pdfFrame' }, ...... handler: function(button) { pdfFrame.hostMIF.showMask('Please wait while we prepare your pack...');
I have also got the callback working. Not sure why it wasn't working before
Thanks for your assistance.
-
22 Dec 2010 8:22 AM #769
@chu_man_fu
Yes, sorry that should have been:
As to the other issue, perhaps you previously lacked the correct content-type to display it inline.Code:pdfFrame.getFrame().showMask(...);
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
13 Jan 2011 5:37 AM #770
iframe Resize
iframe Resize
Hello !
here is my definition:
Is it possible to auto resize the iframe(panel) when the window is resized or maximized ? I tried height: '100%' but it does not work. I get a height about 150px and it does not resize when I use 100%. Thank you for your help!Code:<?php global $t, $db, $app_config;?> iframePanel = new Ext.ux.ManagedIFrame.Panel({ collapsible : false, name : 'cms_vorschau_panel', id : 'cms_vorschau_panel', width: '100%', height: 550, autoScroll : true, animCollapse : false, disableMessaging : false, resizable : true, defaultSrc : 'http://www.dslweb.de', msgMode : 1 }); // Iframe orders window IframeWindow = function() { IframeWindow.superclass.constructor.call(this, { title: 'Vorschau', name : 'cms_vorschau_window', id : 'cms_vorschau_window', width: 900, iconCls: 'nav_vorschau', height: 550, bodyStyle: 'padding:5px;', buttonAlign: 'center', modal: true, collapsible: true, maximizable: true, resizable: true, closable: true, items: iframePanel }) }; Ext.extend(IframeWindow, Ext.Window, {}); iframeWindow = new IframeWindow(); iframeWindow.show();
Best regards


Reply With Quote


