PDA

View Full Version : [CLOSED] creating tabStrip in javascript



supera
May 10, 2012, 6:42 PM
Hi
I wish create a tabStrip in the javascript. But when the page is render, I get this error:

Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class : Ext.net.TabStrip

I'm trying with this sample code:



<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
<title>TabStrip and TabStripItem - Ext.NET Examples</title>

<script type="text/javascript" >
Ext.onReady(function () {
Ext.create("Ext.net.TabStrip", {
id: "TabStrip1",
renderTo: "App.TabStrip1_Container",
items: [{
actionItem: "elm1",
text: "Summary"
}, {
actionItem: "elm2",
text: "Data"
}],
activeTab: 0
});
});
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<div id="elm1" style="padding:5px;">Summary</div>
<div id="elm2" style="padding:5px;">Data</div>

</form>
</body>
</html>

Daniil
May 10, 2012, 6:50 PM
Hi,

Please add:

protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
ResourceManager.RegisterControlResources<TabStrip>();
}
}

and replace

renderTo: "App.TabStrip1_Container",
with

renderTo: Ext.getBody(),
as there is no "App.TabStrip1_Container" on your page.

supera
May 10, 2012, 6:58 PM
Hi Daniil!

Works very fine!

Thanks a lot!