[CLOSED] Window popup

  1. #1

    [CLOSED] Window popup

    I have created an ext:window in my page that I want to use as a popup for various aspx pages.

    <ext:Window ID="UserPopup" runat="server" Resizable="false" Closable="true" Hidden="true" Layout="FitLayout">
       <Loader runat="server" Mode="Frame" DisableCaching="true" Url="./UserInactivate.aspx?Ids=0">
          <LoadMask ShowMask="true" />
       </Loader>
    </ext:Window>
    1) Do I need to give it a default URL?

    My inactive button is defined as:

    <ext:Button ID="UserInactivate" runat="server" Text="Inactivate" Icon="Delete" Disabled="true">
       <Listeners>
          <Click Fn="showInactivateUsersPopup" />
       </Listeners>
    </ext:Button>
    And thus the code to popup my window is below. I am passing it the userids that are currently selected in the grid. My window is coming up, but is this the best way to perform the action?

    // Show the user inactivation confirmation popup passing the currently selected userIds values as URL parameters.
    function showInactivateUsersPopup() {
    
       //#{UserPopup}.loader.url = './UserInactivate.aspx';
       //#{UserPopup}.loader.params = {Ids: getSelectedRecordIds(#{ActiveUsersGridPanel}.getSelectionModel()).join(',') };
       #{UserPopup}.show(this);
       #{UserPopup}.title = 'Inactivate User(s)';
    
       // The Inactivate User window is an autoload iFrame, meaning it is a full page (not just a control).
       // In order to get all of the selected userIds to it, the most straightforward solution is to
       // rewrite the url with a "Ids" param whose value is a comma-seperated list of userIds.
       #{UserPopup}.load({
             url: './UserInactivate.aspx',
             params: {Ids: getSelectedRecordIds(#{ActiveUsersGridPanel}.getSelectionModel()).join(',') },
             scripts: true,
             discardUrl: true,
             nocache: true
       });
    }
    
    // Returns the user ID for each record currently selected in the grid.
    function getSelectedRecordIds(selectionModel) {
       return Ext.Array.pluck(Ext.Array.pluck (selectionModel.getSelection(), 'data'), 'UserId');
    }
    Last edited by Daniil; May 02, 2012 at 5:47 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Quote Originally Posted by cwolcott View Post
    1) Do I need to give it a default URL?
    No, you don't if you would set up
    AutoLoad="false"
    Example
    <ext:Window runat="server">
        <Loader runat="server" Mode="Frame" AutoLoad="false" />
    </ext:Window>
    Quote Originally Posted by cwolcott View Post
    And thus the code to popup my window is below. I am passing it the userids that are currently selected in the grid. My window is coming up, but is this the best way to perform the action?
    Yes, I think the ways how you load the page, passing the parameters and retrieves ids of selected rows are good.

    Some notes.

    scripts: true
    It makes sense with
    Mode="Html"
    only. And it's true by default. So, you can remove it if you use
    Mode="Frame"
    See also
    http://docs.sencha.com/ext-js/4-1/#!...er-cfg-scripts

    nocache: true
    Please use "disableCaching" instead. It's true by default.

    discardUrl: true
    There is no such option anymore and no "defaultUrl" as well. Actually, I don't think you need this option at all since you don't use auto refreshing.
  3. #3
    Thank you for the input. Please close the thread.

Similar Threads

  1. Replies: 1
    Last Post: Jun 18, 2012, 3:41 PM
  2. [CLOSED] How to remove 'X' (window close) for popup window?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 31, 2011, 3:50 AM
  3. [CLOSED] Button event is not firing in parent window from popup window
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 14, 2011, 7:35 PM
  4. Replies: 1
    Last Post: Mar 14, 2011, 4:20 PM
  5. Replies: 1
    Last Post: Mar 11, 2011, 10:07 PM

Posting Permissions