ColumnTree doesn't exist in Ext.Net 2

  1. #1

    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

    <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="&amp;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 5:12 PM. Reason: Please use [CODE] tags
  2. #2
    Hi @vperez23,

    Now a common TreePanel supports additional columns.
    http://examples2.ext.net/#/TreePanel/Advanced/TreeGrid/
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @vperez23,

    Now a common TreePanel supports additional columns.
    http://examples2.ext.net/#/TreePanel/Advanced/TreeGrid/
    Much Thank It's perfect I will use It... Can I fill TreePanel from Json in JavaScrip???
  4. #4
    Take a look on the following Thread: http://forums.ext.net/showthread.php...Treepanel-Grid

    it's just to advise that you can have only one TreeColumn
  5. #5
    Quote Originally Posted by vperez23 View Post
    Can I fill TreePanel from Json in JavaScrip???
    I would use the setRootNode method.
    http://docs.sencha.com/ext-js/4-1/#!...od-setRootNode

Similar Threads

  1. [CLOSED] gridPanel after edit event doesn't exist
    By Daly_AF in forum 2.x Premium Help
    Replies: 2
    Last Post: Aug 15, 2012, 11:22 AM
  2. Replies: 5
    Last Post: Aug 06, 2012, 1:21 PM
  3. Replies: 2
    Last Post: Jul 19, 2012, 6:09 PM
  4. Replies: 1
    Last Post: Nov 19, 2011, 9:32 AM
  5. DirectMethod OnLoad event does not exist
    By alvaromagnum in forum 1.x Help
    Replies: 3
    Last Post: Jul 17, 2011, 9:27 AM

Tags for this Thread

Posting Permissions