How can I popup an aspx page using Extjs Popup window - extjs

I need to popup an aspx page in a Extjs Popup window.For popup I am using Ext.Window.
Can someone help me how can I popup an Aspx page using Ext.Window?
Thanks in Advance.

You can add an iframe to the window. Here's an example derived from something i did recently:
Ext.define('App.view.myWindow', {
extend: 'Ext.window.Window',
title: 'My Window',
xtype:'myWindow',
itemId: 'myWindow',
width: 1500,
height:800,
items: [{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'box',
itemId: 'iFrameInWindow',
title: 'IFrame',
autoEl: {
tag: 'iframe',
src: 'about:blank'
},
flex: 1
}]
}]
});

Related

How to render a hidden window?

I have an iframe (fit in a window) to load before showing it.
When I do :
window.show();
window.hide();
The window is not hidden. "window.show()" is used to render the iframe.
The loading of the iframe is about 10 sec.
How can I render the iframe without display the window?
My window :
var win = Ext.create('Ext.window.Window', {
height: '95%',
width: '95%',
modal: true,
header: false,
hideMode:'visibility',
constrain: true,
resizable:false,
itemId:'winIframeItemId....',
id:'winIframeId....',
baseCls: 'x-window-....',
layout: {
type: 'vbox',
align: 'stretch',
pack: 'start'
},
items: [{
xtype: 'container',
layout: {
type: 'hbox',
align: 'middle',
pack: 'end'
},
items: [{
xtype: 'button',
cls: 'x-button-close-window...',
height: 34,
width: 34
...
}]
}, {
xtype: 'container',
itemId:'conIframeWindow',
layout:"fit",
flex: 1,
items: [{
xtype: 'component',
autoScroll: true,
itemId:'IframeTest',
baseCls: 'x-component-w....',
autoEl: {
tag: "iframe",
domain: '....',
frameborder: 0,
src: url
}
}]
}]
});
Windows and menus are typically rendered to the document body. I was able to use the Ext.Component.renderTo configuration to render windows and menus without displaying them.
https://fiddle.sencha.com/#view/editor&fiddle/2f5h
// Render a hidden window.
var window = Ext.create('Ext.window.Window', {
renderTo: Ext.getBody(),
title: 'Window'
});
// Render a hidden menu.
var menu = Ext.create('Ext.button.Button', {
menu: {
items: [{
text: 'Item'
}],
renderTo: Ext.getBody()
},
text: 'Button'
});

Ext.js, Nested Form panel not scrolling on mobile devices

I am new to Ext.js & am having some issues scrolling a nested form on mobile devices. I have a grid panel & a form panel both inside the 'center' panel & I hide one depending on which selection was chosen in west panel. The grid section works fine (& scrolls in mobile thanks to the bufferedrenderer plug-in.) but I can't get the form to. It scrolls fine in desktop view & it even scrolls when I preview the mobile view in Chrome dev tools but when I try to use it on an actual device, there are no scroll bars & I can not drag the screen either. I've tried so many different ways but here's the gist of what I have. Any suggestions are appreciated.
Ext.define('App.view.main.Main', {
extend: 'Ext.container.Container',
plugins: ['viewport', 'responsive'],
xtype: 'app-main',
autoscroll: true,
defaults: {autoscroll: true},
overflowY: 'auto',
responsiveConfig: {
tall: {
layout: {
type: 'auto'
}
},
wide: {
layout: 'border'
}
},
items [{
xtype: 'panel',
region'north'
},{
xtype: 'panel',
region'west'
},{
xtype: 'panel',
region:'center'
autoscroll: true,
layout: 'fit',
items: [{
xtype: grid,
......
},{
xtype: 'form',
layout: 'fit',
height: '500',
autoscroll: true, //this does nothing??
overflowY: auto, //this does nothing either???
responsiveConfig: {
wide: {
layout: 'hbox'
},
tall: {
layout: 'auto'
}
},
layout: {
type: 'box',
align: 'stretch'
},
items: [{
xtype: 'textfield'
},{
xtype: 'textfield'.....
}]
}]
}]

Why does the first panel of ExtJS 4.2.1 accordion layout never close?

I have an ExtJS 4.2.1 accordion layout with three panels.
When the app is first launched, the first panel is open and the 2nd/3rd are closed.
I can open and close the 2nd and 3rd, but I can never close the first panel.
Ext.define('MyAccordion', {
extend: 'Ext.container.Container',
alias: 'widget.myAccordion',
padding: 0,
margin: 0,
width: 200,
layout: {
type: 'accordion',
align: 'stretch',
animate: true,
hideCollapseTool: true
},
items: [{
xtype: 'panel',
title: 'Test Volumes',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'label',
text: 'volume one'
},{
xtype: 'label',
text: 'volume two'
},{
xtype: 'label',
text: 'volume three'
}]
}, {
xtype: 'panel',
title: 'Production Volumes',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'label',
text: 'volume one'
},{
xtype: 'label',
text: 'volume two'
},{
xtype: 'label',
text: 'volume three'
}]
}, {
xtype: 'panel',
title: 'Extra Volumes',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'label',
text: 'volume one'
},{
xtype: 'label',
text: 'volume two'
},{
xtype: 'label',
text: 'volume three'
}]
}]
});
In the following code leveraged from the 4.2.1 examples layout browser example, if the first thing you do after launching the app is click the first header, is does close, but then re-open it and it never closes again:
Ext.onReady(function() {
Ext.create('Ext.container.Viewport', {
renderTo: Ext.getBody(),
items: [{
xtype: 'panel',
title: 'Accordion Layout',
layout: 'accordion',
defaults: {bodyStyle: 'padding:15px'},
items: [{
title: 'Introduction',
tools: [{type:'gear'},{type:'refresh'}],
html: '<p>Here is some accordion content. Click on one of the other bars below for more.</p>'
},{
title: 'Basic Content',
html: '<br /><br /><p>More content. Open the third panel for a customized look and feel example.</p>',
items: {
xtype: 'button',
text: 'Show Next Panel',
handler: function(){
Ext.getCmp('acc-custom').expand(true);
}
}
},{
id: 'acc-custom',
title: 'Custom Panel Look and Feel',
cls: 'custom-accordion', // look in layout-browser.css to see the CSS rules for this class
html: '<p>Here is an example of how easy it is to completely customize the look and feel of an individual panel simply by adding a CSS class in the config.</p>'
}]
}]
});
});
Even more strange, if I do show the collapse/expand tool, the tool for the first panel stops working.
Amazing but true, but this happens because the accordion layout container does not have a height set.
Because I can't have a fixed height, this fixes the issue: flex: 1
But this seems really strange, because why should not having a height (or flex, etc) break closing the first container? Just seems weird.
An easy solution would be to add _isLayoutRoot: true to panel with accordion layout.
Ext.define('myAccordion',{
extend: 'Ext.Panel',
alias: 'widget.myAccordion',
layout: 'accordion',
_isLayoutRoot: true,
items: myItems
});
Example: http://jsfiddle.net/38mx9hs9/1/
Also it seems that this issue is fixed in 4.2.2:
https://www.sencha.com/forum/showthread.php?267163-4-2-1-Accordion-Layout-in-Panel&p=1169533#post1169533

Need to resize the Ext.Window based on the control render on it

I need to resize my popup created by using Ext.Window based on the controls render on it.
I popup an aspx page and dynamically creating control on it. So i can't hard code the height of the window.
How can I resize the popup window height. Please help me with your valueable information.
My code is as follows.
Ext.onReady(function () {
var myWin = new Ext.Window({
title: 'Add to Favourit',
width: 380,
height: 300,
closable: true,
buttonAlign: 'center',
items: [{
xtype: 'panel',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'box',
itemId: 'iFrameInWindow',
title: 'IFrame',
autoEl: {
tag: 'iframe',
src: 'forms/test.aspx?id=1'
},
flex: 1,
width: 380,
height: 300,
}],
listeners: {
afterrender: function () {
//
},
}
}]
});
myWin.show();
});
Thanks in advance.

Multiple Buttons of Toolbar in Sencha Touch

i need to intimate the user that toolbar contains the scroll bar and there is some more buttons in the toolbar.
Any sample code for the issue.
thanks in advance...
You may try something like this (in Sencha Touch 2):
var toolbar = Ext.create('Ext.Panel', {
id: 'meetingList',
flex: 1,
scrollable: {direction: 'horizontal', indicators: false},
defaults: {width: 200},
items: [{
xtype: 'button',
text: 'Button1'
},{
xtype: 'button',
text: 'Button2'
},
....
]
});

Resources