[CLOSED] migrating ext.window javasript to 2.x

  1. #1

    [CLOSED] migrating ext.window javasript to 2.x

    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.
    Last edited by Daniil; Jan 12, 2015 at 5:34 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Is this what you are looking for?

    https://examples2.ext.net/#/Window/B...ernal_Website/
  3. #3
    There were a bunch of Breaking Changes to the AutoLoad config in 2.0.0.

    https://examples2.ext.net/#/Getting_...AKING_CHANGES/

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

    Hope this helps.
    Geoffrey McGill
    Founder
  4. #4
    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?
  5. #5
    Please try to replace
    mode: "iframe"
    with
    renderer: "frame"
  6. #6
    Nope, alredy tried that.

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

    http://docs.sencha.com/extjs/4.0.7/#....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.
  7. #7
    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.
  8. #8
    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.

Similar Threads

  1. Breaking changes migrating from Ext.NET v1 to v2
    By Daniil in forum Open Discussions
    Replies: 19
    Last Post: Dec 09, 2013, 6:21 AM
  2. [CLOSED] Migrating from v1.5 to 2.0.1 differences.
    By ViDom in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 27, 2012, 1:47 PM
  3. [CLOSED] Migrating a MVC App from v1 to v2
    By RCN in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 10, 2012, 7:05 PM
  4. [CLOSED] Use Javasript
    By trieu.tran in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 30, 2012, 9:25 AM
  5. [CLOSED] access store in external javasript
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 06, 2008, 11:03 AM

Posting Permissions