PDA

View Full Version : [CLOSED] Personalise the buttom to close the control panel



opendat2000
Jul 03, 2014, 8:19 PM
Hi-Team !!

I have the following problem, i want to personalise the buttom to close the control panel, and for that i implemented the following code, control panel, closable property = false, then add the control tool, when i run this exercise i didnt get the expected result.

As additional information, indicate that the panels will be created dynamically.




<%@ 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)
{
Ext.Net.ComponentLoader theComponentLoader = new Ext.Net.ComponentLoader();
Ext.Net.Panel thePanel1 = new Ext.Net.Panel();
Ext.Net.Panel thePanel2 = new Ext.Net.Panel();
Ext.Net.Panel thePanel3 = new Ext.Net.Panel();
Ext.Net.Tool theTool = new Ext.Net.Tool();

theTool.ID = "Tool1";
theTool.ToolTip = "Cerrar";
theTool.CustomType = "my-close";
theTool.Handler = "owner.ownerCt.close();";
theTool.Width = Unit.Pixel(19);
theTool.Height = Unit.Pixel(19);

theComponentLoader.ID = "ComponentLoader1";
theComponentLoader.Url = "http://www.ext.net/";
theComponentLoader.LoadMask.ShowMask = true;
theComponentLoader.LoadMask.Msg = "Cargando... ";
theComponentLoader.Mode = LoadMode.Frame;

thePanel1.ID = "Panel1";
thePanel1.Title = "Ext .Net";
thePanel1.Closable = false;
thePanel1.Reorderable = true;
thePanel1.Border = false;
thePanel1.Loader = theComponentLoader;
thePanel1.AddTool(theTool);
thePanel1.Height = 550;
thePanel1.Layout = "Fit";
thePanel1.LoadContent();
thePanel1.AddTo(TabPanelContenido);
thePanel1.Render();
TabPanelContenido.SetActiveTab(thePanel1);
}
}
</script>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" IDMode="Static" Theme="Neptune"/>

<form id="form1" runat="server">
<div>
<ext:TabPanel ID="TabPanelContenido" runat="server"
Region="Center"
Border="false">
<Plugins>
<ext:BoxReorderer ID="BoxReorderer1" runat="server" />
</Plugins>
</ext:TabPanel>
</div>
</form>
</body>
</html>



Any idea or help will be appreciated.

Daniil
Jul 04, 2014, 7:49 AM
Hi @opendat2000,

A Panel's Tools are going to a Panel's header. A tab is not considered as a Panel's header. So, the approach that you tried doesn't work.

I can suggest:

thePanel1.Closable = true;
thePanel1.TabConfig = new Ext.Net.Button
{
Cls = "my-close",
ToolTips =
{
new ToolTip
{
Delegate = ".x-tab-close-btn",
Html = "My ToolTip"
}
}
};

<style>
.my-close .x-tab-close-btn {
background-image: url("my-close.png");
}
</style>

Also please note that the AddTool, AddTo, Render, SetActiveTab methods should be used during a DirectEvent or a DirectMethod only.

opendat2000
Jul 04, 2014, 2:10 PM
Daniil

Thank you very much for your support and comments I have implemented your suggestions and respond to it which required.

Thread closed ....

Saludos
Mauricio.