May 01, 2012, 7:37 PM
[CLOSED] Window popup
I have created an ext:window in my page that I want to use as a popup for various aspx pages.
My inactive button is defined as:
<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]