Nov 13, 2012, 4:02 PM
ColumnTree doesn't exist in Ext.Net 2
I was using <ext:ColumnTree> in Ext.Net 1x but now..... I have to change it with Ext.Net 2x but I don't find <ext:ColumnTree> What control Do I have to use? I was using a [DirectMethod] and I return Json to fill my <ext.ColumnTree>.. This is my code for Ext.Net 1x but now .... How Can I do???
I hope someone can help me... Thanks..
------- ASPX
---- CodeBehind with Direct Method
---- JavaScrip to fill
I hope someone can help me... Thanks..
------- ASPX
<ext:TabPanel ID="PanelPdf" runat="server" AutoWidth="true" Height="875"
AutoScroll="true">
<Items>
<ext:Panel runat="server" ID="z_pnl_inicio" Header="false" Border="false" Height="840" AutoWidth="true"
Padding="10" Title="Explorador Documentos PDF" Icon="ApplicationOsx">
<Content>
<ext:Panel ID="panel1" runat="server" Title="Viajes Terminados" Frame="true" AutoWidth="true" Height="830"
Padding="5" Border="true">
<Items>
<ext:FitLayout ID="fitLayout2" runat="server" AutoWidth="true">
<Items>
<ext:ColumnTree ID="columnTree1" runat="server" RootVisible="true"
Title="&nbsp;" Border="true" UseArrows="true" Mode="Remote"
Animate="true" AutoWidth="true">
<Co lumns>
<ext:ColumnTreeColumn Header="Viajes" Width="130" DataIndex="Viaje" />
<ext:ColumnTreeColumn Header="No Guia" Width="100" DataIndex="Guia" />
<ext:ColumnTreeColumn Header="Viaje NISSAN" Width="80" DataIndex="ViajeNissan" />
<ext:ColumnTreeColumn Header="FechaEnvio" Width="150" DataIndex="Fecha" />
<ext:ColumnTreeColumn Header="Factura" Width="80" DataIndex="NoFactura" />
<ext:ColumnTreeColumn Header="Operador" Width="200" DataIndex="Operador" />
<ext:ColumnTreeColumn Header="Placas" Width="80" DataIndex="Placas" />
</Columns>
<Loader>
<ext:TreeLoader>
<UIProviders>
<ext:TreeNodeUIProvider Alias="col" ClassName="<%# ColumnTree.ColumnNodeUI %>" AutoDataBind="true" />
</UIProviders>
</ext:TreeLoader>
</Loader>
<Root>
<ext:TreeNode NodeID="root" Hidden="true" />
</Root>
</ext:ColumnTree>
</Items>
</ext:FitLayout>
</Items>
</ext:Panel>
</Content>
</ext:Panel>
</Items>
</ext:TabPanel>
---- CodeBehind with Direct Method
try
{
UO_MetodosDefault z_metodos = new UO_MetodosDefault();
z_dataset = z_metodos.z_MetBuscaViajesGuias(folioviaje, claveoperador, fechainicial, fechafinal, viajeNISSAN, placas);
if (z_dataset != null)
{
if (z_dataset.Tables["ReportesPDF"].Rows.Count > 0)
{
if (z_dataset.Tables["ReportesPDF"].Rows[0][1].ToString() != "SQL_ERROR")
{
System.Collections.Generic.List<EmployeeTimeReg> list1 = new System.Collections.Generic.List<EmployeeTimeReg>();
for (int i = 0; i < z_dataset.Tables["ReportesPDF1"].Rows.Count; i++)
{
list1.Add(new EmployeeTimeReg { Viaje = z_dataset.Tables["ReportesPDF1"].Rows[i]["ViajeTUM"].ToString() });
}
System.Collections.Generic.List<EmployeeTaskTimeReg> list2 = new System.Collections.Generic.List<EmployeeTaskTimeReg>();
for (int i = 0; i < z_dataset.Tables["ReportesPDF"].Rows.Count; i++)
{
list2.Add(new EmployeeTaskTimeReg
{
Viaje = z_dataset.Tables["ReportesPDF"].Rows[i]["ViajeTUM"].ToString(),
PakingList = z_dataset.Tables["ReportesPDF"].Rows[i]["Guia"].ToString(),
ViajeNissan = z_dataset.Tables["ReportesPDF"].Rows[i]["ViajeNissan"].ToString(),
FechaEnvio = z_dataset.Tables["ReportesPDF"].Rows[i]["Fecha"].ToString(),
NoFactura = z_dataset.Tables["ReportesPDF"].Rows[i]["NoFactura"].ToString(),
Operador = z_dataset.Tables["ReportesPDF"].Rows[i]["Operador"].ToString(),
Placas = z_dataset.Tables["ReportesPDF"].Rows[i]["Placas"].ToString()
});
}
Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection();
Ext.Net.TreeNode root = new Ext.Net.TreeNode("Viajes") { Expanded = true, NodeID = "0" };
nodes.Add(root);
foreach (EmployeeTimeReg item1 in list1)
{
Ext.Net.TreeNode node = new Ext.Net.TreeNode();
node.UIProvider = "col";
node.CustomAttributes.Add(new Ext.Net.ConfigItem("Viaje", item1.Viaje, Ext.Net.ParameterMode.Value));
node.Listeners.DblClick.Handler = "function(data){addTab(#{PanelPdf}, 'btnimg1', 'ASPX/VisorRS.aspx','ExploradorSalida', 'Salida', data.attributes.Viaje, '')}";
////node.Listeners.DblClick.Handler = "function(data){addTab(#{PanelPdf}, 'btnimg1', 'ASPX/Visor.aspx','ExploradorPdf', data.attributes.Viaje, '', '', '')}";
foreach (EmployeeTaskTimeReg item2 in list2)
{
if (item1.Viaje == item2.Viaje)
{
Ext.Net.TreeNode nodeChild = new Ext.Net.TreeNode();
nodeChild.UIProvider = "col";
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("Viaje", item2.Viaje, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("Guia", item2.PakingList, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("ViajeNissan", item2.ViajeNissan, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("Fecha", item2.FechaEnvio, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("NoFactura", item2.NoFactura, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("Operador", item2.Operador, Ext.Net.ParameterMode.Value));
nodeChild.CustomAttributes.Add(new Ext.Net.ConfigItem("Placas", item2.Placas, Ext.Net.ParameterMode.Value));
nodeChild.Icon = Ext.Net.Icon.PageWhiteAcrobat;
nodeChild.Listeners.DblClick.Handler = "function(data){addTab(#{PanelPdf}, 'btnimg12', 'ASPX/VisorRS.aspx','ExploradorGuia', 'Guia', data.attributes.Viaje, data.attributes.Guia)}";
////nodeChild.Listeners.DblClick.Handler = "function(data){addTab(#{PanelPdf}, 'btnimg1', 'ASPX/Visor.aspx','ExploradorPdf', data.attributes.Viaje, data.attributes.Guia, '', '')}";
nodeChild.Leaf = true;
node.Nodes.Add(nodeChild);
}
}
root.Nodes.Add(node);
}
return nodes.ToJson();
}
---- JavaScrip to fill
function buscar() {
panel1.el.mask('Buscando...', 'x-loading-mask', false);
Cool.buscar(z_txt_viaje.getValue(), z_CboBox_operador.getValue(),
(z_DateFld_AltaInicial.getValue() == '') ? '' : z_DateFld_AltaInicial.getValue().toDateSQLRango('Inicio'),
(z_DateFld_AltaFinal.getValue() == '') ? '' : z_DateFld_AltaFinal.getValue().toDateSQLRango('Fin'),
z_txtViajeNissan.getValue(), z_txtTipoPlacas.getValue(), {
success: function (msg) {
if (msg != 'error' && msg != 'vacio') {
var nodes = eval(msg);
columnTree1.initChildren(nodes);
panel1.el.unmask();
}
else if (msg == 'vacio') {
columnTree1.destroyRoot();
Ext.Msg.alert('Aviso', "No se encontraron registros con los filtros de Busqueda especificados.");
panel1.el.unmask();
}
},
failure: function (msg) {
Ext.Msg.alert('Alerta', "No se puedo establecer comunicacion con el Servidor.");
panel1.el.unmask();
}
});
}
Last edited by Daniil; Nov 13, 2012 at 4:12 PM.
Reason: Please use [CODE] tags