Results 1 to 5 of 5

Thread: Window + closable

  1. #1
    Ext User
    Join Date
    Oct 2008
    Posts
    12

    Default Window + closable

    Code:
    function showCreative(copyid, productid){
        winCreative = new Ext.Window({
            title: 'Creative'
            ,autoHeight: true
            ,width: 750
            ,draggable: false
            ,resizable: false
            ,y: 313
            ,modal: true
            ,closable: false
            ,items:{autoLoad: '/Agency/creative.cfm?copyID=' + copyid + '&productID=' + productid}
        });
        winCreative.show();
    };
    I did a search on window + closable, unfortunately the two key terms are very common. My problem is this: I don't want a user to close this modal window. Reading through the API, I thought this would disable the user from closing the window but it doesn't seem to work. Any information why this is?

    I guess my next best choice is to use closeAction and just give the user an alert message saying Close is disabled.

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    How is the user able to close the window? The close toolbutton shouldn't be visible!

    ps. You can reject a close by returning false from the beforeclose event.

  3. #3
    Ext User
    Join Date
    Oct 2008
    Posts
    12

    Default Thanks

    Thanks, I'm either going to always return false or use the closeAction to display an alert box. But more than getting more work done, I'm curious why this is happening. I see the little X mark in the right hand corner. I created a new window in another page and it doesn't close there either. Maybe because I render to a <div>?

    Code:
    <script type="text/javascript" src="window2.js"></script>
    <div id="layout_window" style="height:750px;"></div>

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    I don't see you rendering to a div in your first example !?!

    modal windows should be rendered to document.body (otherwise they aren't modal).

    If layout_window is a direct child of document.body you could use applyTo or applyToMarkup() instead of renderTo or render().

  5. #5
    Ext User
    Join Date
    Oct 2008
    Posts
    12

    Default

    Yeah. Sorry I wasn't clear about that. The user visits page layout.cfm and it calls window2.js (the first code snipet was window2.js and the second one is layout.cfm). The function showCreative is called from within window2.js which is, I assume is being rendered, to the div tag. the the first thing window2.js does is create the main window, win, but I don't use render option or applyTo option. I just use show.

    Either way, I like your suggestion better and got it working the way I want. Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •