Vladimir implemented this feature in Ext.NET v2.
Now you can configure the ResourceManager App property.
There are the two options available.
true (default) - the initialization Ext.onReady script will be executed automatically.
false - the initialization Ext.onReady script will be deferred. This script will be moved to the initialization "App.initFn" function which you can call manually when needed.
Please note that The "App" is the default Namespace which can be changed setting the ResourceManager Namespace property or the namespace option of the Ext.NET section in Web.config.
The name of the initialization function. Defaults to "initFn".
Thank you for the great suggestion, Frank!
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" },
};
store.DataBind();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server">
<App AutoInit="false" />
</ext:ResourceManager>
<input type="button" value="Run" onclick="App.initFn();" />
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test1" DataIndex="test1" />
<ext:Column runat="server" Text="Test2" DataIndex="test2" />
<ext:Column runat="server" Text="Test3" DataIndex="test3" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</body>
</html>