PDA

View Full Version : [CLOSED] Window loader parameters



ndotis
Nov 19, 2013, 12:57 AM
Hello

Ext-2.3
How to set the window loader parameter values dynamically

Here is the code snippet i was trying


<ext:Panel ID="newTab" runat="server" Title="Evaluation Criteria Items" Flex="1"
Border="false" Padding="2" Header="false">
<Loader runat="server" Url="" Mode="Frame" ReloadOnEvent="true" TriggerEvent="show" ShowMask="true" >
<Params>
<ext:Parameter Name="listSPName" Mode="Value" />
<ext:Parameter Name="saveSPName" Mode="Value" />
<ext:Parameter Name="grdTitle" Mode="Value" />
</Params>
</Loader>
</ext:Panel>



<script type="text/javascript">
var win = <%=newTab.ClientId %>;
win.loader.url = 'ListReferenceData.aspx';
win.loader.paramsFn().listSPName = 'ListEnvDocTypes';
win.loader.paramsFn().saveSPName = 'SaveEnvDocTypes';
win.loader.paramsFn().grdTitle = 'Environmental Document Types';


App.direct.ShowDetails({
failure: function (errorMsg) {
Ext.Msg.alert('Error', errorMsg);
}
})
}
</script>


aspx.vb page code

<DirectMethod([RethrowException]:=True, [ShowMask]:=True)> _
Public Sub ShowDetails()

Me.newTab.LoadContent((New ComponentLoader() With { _
.Url = "ListReferenceData.aspx", _
.Mode = LoadMode.Frame, _
.DisableCaching = True _
})

Me.newTab.Show()
)

End Sub

Baidaly
Nov 19, 2013, 1:26 AM
Hello!

Take a look at this sample:


<%@ Page Language="C#" %>

<%@ Import Namespace="Panel=Ext.Net.Panel" %>

<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<script runat="server">

[DirectMethod]
public static string AddTab(string parameters)
{
Dictionary<string, string> prms = JSON.Deserialize<Dictionary<string, string>>(parameters);

return ComponentLoader.ToConfig(new Panel {
Title = prms["name"],
Icon = Icon.TabAdd,
Html = "Server time: " + DateTime.Now.ToLongTimeString()
});
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
</head>
<body>

<ext:ResourceManager runat="server" DirectEventUrl="Default.aspx">
<Listeners>
<DocumentReady Fn="bindParams" />
</Listeners>
</ext:ResourceManager>

<script>
var bindParams = function() {
var tabPanel = <%= TabPanel1.ClientID %>;
tabPanel.loader.params = { name: '<%= TabPanel1.ClientID %>_test' };
}
</script>

<ext:TabPanel
runat="server"
Height="200"
ID="TabPanel1"
Width="500">
<Loader
runat="server"
AutoLoad="false"
RemoveAll="false"
DirectMethod="#{DirectMethods}.AddTab"
Mode="Component">
<LoadMask ShowMask="true" />
<Params>
</Params>
</Loader>
<Items>
<ext:Panel runat="server" Title="Tab 1" />
</Items>
<Buttons>
<ext:Button runat="server" Text="Add Tab" Icon="PluginGo">
<Listeners>
<Click Handler="
this.up('panel').load({
callback:function(){this.setActiveTab(this.items.g etCount()-1)},
scope: this.up('panel')
});" />
</Listeners>
</ext:Button>
</Buttons>
</ext:TabPanel>
</body>
</html>

ndotis
Nov 26, 2013, 8:59 PM
Thanks,
You can close this request.