PDA

View Full Version : [CLOSED] migrating ext.window javasript to 2.x



jcanton
Jan 09, 2015, 3:25 PM
Hello,

I'm migrating our web client to 2.x. on version 1.x I have a javascript funtion wich dinamically creates a window and opens an url inside it.



<script type="text/javascript">
var newWindow = function (url, config) {
new Ext.Window(Ext.apply({
renderTo: Ext.getBody(),
resizable: false,
title: "Test",
height: 500,
width: 500,
frame: true,
autoLoad: {
showMask: true,
mode: "iframe",
url: url
}
}, config)).show();
}
</script>


Unfortunatelly on version 2.x the window is created and opened but the content of the url is not shown . (the url wich is another aspx page is called)

How I have to change this function to get it working again?

Thanks.

Dimitris
Jan 09, 2015, 3:57 PM
Hi,

Is this what you are looking for?

http://examples2.ext.net/#/Window/Basic/Load_External_Website/

geoffrey.mcgill
Jan 09, 2015, 4:28 PM
There were a bunch of Breaking Changes to the AutoLoad config in 2.0.0.

http://examples2.ext.net/#/Getting_Started/Release_Documents/BREAKING_CHANGES/

See Item #71 in the 2.0.0 Breaking Changes, or search for "AutoLoad" in the document.

Hope this helps.

jcanton
Jan 12, 2015, 3:18 PM
I have seem both the examples and the breaking changes.

On c# .net I have no problems, the problem is in this case that I cannot do it on c# in this point and I have to do it on javascript and I do not know how to change the previous script to the new loader config stuff in javascript.

Any hints?

Daniil
Jan 12, 2015, 3:26 PM
Please try to replace

mode: "iframe"
with

renderer: "frame"

jcanton
Jan 12, 2015, 4:21 PM
Nope, alredy tried that.

In fact according the documentation, the autoload property is not longer available

http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.window.Window

And it also seems that I cannot use the "new Ext.Window" anymore but I'm a bit lost here as I do not usually program in javascript.

Daniil
Jan 12, 2015, 4:44 PM
Nope, alredy tried that.

Please clarify what happened after that try?


the autoload property is not longer available

We still support it in JavaScript for backwards compatibility.


And it also seems that I cannot use the "new Ext.Window"

Why does it seem show? It should be OK to use.

I tried your code with my change mentioned in the previous post and it appears to be working.

Please provide a full runnable test case.

jcanton
Jan 12, 2015, 4:55 PM
Sorry, my mistake I was changing it to



mode: "frame"

instead of


renderer: "frame"

Now it works ok.

The resulting code is



<script type="text/javascript">
var newWindow = function (url, config) {
new Ext.Window(Ext.apply({
renderTo: Ext.getBody(),
resizable: false,
title: "Test",
height: 500,
width: 500,
frame: true,
autoLoad: {
showMask: true,
renderer: "frame",
url: url
}
}, config)).show();
}
</script>

Thanks. this issue is solved.