• Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)
  • Cuixer, una forma de administrar páginas web que nunca viste!

Problema al empaquetar el Grid en una variable a un Panel

Foros generales de ayuda Ext 3.0.
Avatar de Usuario
Ext.foro.Nuevo
Mensajes: 6
Registrado: 09 Dic 2011, 13:31
NotaPublicado: 09 Dic 2011, 13:54
Hola soy nuevo en el uso del Framewok de Ext JS, ya tengo el diseño de la interfaz del Grid que le asigno por medio de unos array los valores al Grid, como le muestro :

Código: Seleccionar todo
<script type="text/javascript" >
    Ext.onReady(function() {
        var panel = new Ext.Panel({
            id:'main-panel',
            renderTo: Ext.getBody(),
            height: 380,
         width: 513,
            layout: {
              type: 'table',
              columns: 1
          },
          //border:false,
                           items:[{
                         title:'Datos de la Corporacion',
                             height: 175,
                              columnWidth:.100,
                              layout: {
                                type: 'table',
                                columns: 2
                            },
                              items:[{bodyStyle:'padding:2px 2px 2px 2px', border:false },
                                     {bodyStyle:'padding:2px 2px 2px 2px', border:false},
                                     {bodyStyle:'padding:2px 2px 2px 2px', border:false},
                                     {bodyStyle:'padding:2px 2px 2px 2px', border:false},
                                     {bodyStyle:'padding:2px 2px 2px 2px', border:false},
                                     {bodyStyle:'padding:2px 2px 2px 2px', border:false},
                                    
                                    
                                    {
                                      // title:'identificacion',
                                              height: 30,
                                           columnWidth:.60,
                                           layout: 'form',
                                           border:false,
                                           labelWidth : 140,
                                            items:[ {
                                                       xtype: 'hidden',
                                                       value : '0',
                                                       name: 'corporacion_idCorporacion',
                                                       id: 'corporacion_idCorporacion',
                                                          width:200
                                                      }
                                                 ]
                                     },

                                    {
                                    // title:'vigencia',
                                     height: 30,
                                     columnWidth:.80,
                                     layout: 'column',
                                     border:false,
                                      items:[
                                              {
                                                  xtype: 'checkbox',
                                                    id: 'corporacion_indicadorEstado',
                                                    checked:true,
                                                     boxLabel: 'Vigente'
                                                }
                                           ]
                                   },
                                   
                                     {
                                   // title:'nombre',
                                      columnWidth:.100,
                                      border:false,
                                      layout: 'form',
                                      bodyStyle:'padding:2px 2px 2px 2px',
                                      labelWidth : 120,
                                      colspan:2,
                                      items: [
                                               {
                                               xtype: 'textfield',
                                               name:'corporacion_nombreLargo',
                                               fieldLabel:'Nombre',
                                               type: 'string',
                                               width:200
                                               }
                                            ]
                                  },
                                 {
                                    // title:'siglas',
                                    columnWidth:.100,
                                      border:false,
                                      layout: 'form',
                                      bodyStyle:'padding:2px 2px 2px 2px',
                                      labelWidth : 120,
                                      colspan:2,
                                      items:[
                                    {
                                               xtype: 'textfield',
                                               name:'corporacion_nombreCorto',
                                               fieldLabel:'Siglas',
                                               type: 'string',
                                               width:200
                                         }
                                         ]
                                 },
                                 {
                                    // title:'direccion',
                                    columnWidth:.100,
                                      border:false,
                                      layout: 'form',
                                      bodyStyle:'padding:2px 2px 2px 2px',
                                      labelWidth : 120,
                                      colspan:2,
                                      items:[
                                    {
                                               xtype: 'textfield',
                                               name:'corporacion_direccionLegal',
                                               fieldLabel:'Direccion',
                                               type: 'string',
                                               width:200
                                         }
                                         ]
                                 }
                              
                     ]
                 
                        },
            
                       [b] {
                            title:'Datos de las Sociedades',
                            height: 200,
                            columnWidth:.100,
                          layout: 'table',
                          items:[Grid],
                          bbar: {
                                      xtype: 'paging',
                                      afterPageText: 'de {0}',
                                      beforePageText: 'pagina',
                                      displayInfo: true,
                                      columnWidth:.100,
                                      store: Store
                                     }
                          
                 }]
           
        });
    });

    var Store =new Ext.data.SimpleStore({
      fields:['idSoc','Razon social','Siglas','Direccion','Representante legal','Nro. RUC'],
      data:[
            [1,'RazonS1','RS1','dir 1','rep1','123'],
            [2,'RazonS1','RS1','dir 1','rep1','123'],
            [3,'RazonS1','RS1','dir 1','rep1','123']
            ]
      }) ;
var Columnas=[
               {   dataIndex:'idSoc',
                   header:'IdSoc.',
                   soportable:true,
                   width:50
                },
              {   dataIndex:'Razon Social',
                  header:'Razon Social',
                  soportable:true,
                  width:100  },
              {dataIndex:'Siglas',
                   header:'Siglas',
                      soportable:true,
                      width:100  },
              {dataIndex:'Direccion',
                         header:'Direccion',
                         soportable:true,
                         width:100  },
              {dataIndex:'Representante legal',
                            header:'Representante legal',
                            soportable:true,
                            width:100  },
              {dataIndex:'Nro. RUC',
                               header:'Nro. RUC',
                               soportable:true,
            width:100  }

                      ];
var Grid=new Ext.grid.GridPanel({
         columnWidth:.100,
         height:200,
         columns:Columnas,
         store:Store
   });[/b]

   </script>


En cambio a hora lo empaqueto en variables para su uso posterior de BD, asi es como deberia aceptarme, le incluyo lo mismo solo que el llamado del Grid no me responde como le muestro a continuacion :

Código: Seleccionar todo
<script type="text/javascript" >
      [b]Ext.onReady(function(){
         var PanelMainCorporacion=new Ext.Panel({
                renderTo: Ext.getBody(),
                height: 380,
               width: 513,
               //defaults: { columnWidth:.100, height: 30,border:false },//afecta a todos los hijos(frame:true, para relieve)
            layout:{[/b]
               type:'table',
               columns:1
             },
            [b][color=#BF0000]items:[
                    {items:panelDatosCorporacion},
                    {items:panelDatosSociedades}
                    ][/color][/b]
             
            });
         });
      
   [color=#000000]   var panelDatosCorporacion=new Ext.Panel({
          border:false,
          title:'Datos de la Corporacion',[/color]
            height: 175,
            width:513,
             //columnWidth:.100,
             bodyStyle:'padding:10px 10px 10px 30px',
             layout: {
               type: 'table',
               columns: 2
           },
          items:[                     
                           {
                             // title:'identificacion',
                                     height: 30,
                                  columnWidth:.60,
                                  layout: 'form',
                                  border:false,
                                  labelWidth : 140,
                                   items:[ {
                                              xtype: 'hidden',
                                              value : '0',
                                              name: 'corporacion_idCorporacion',
                                              id: 'corporacion_idCorporacion',
                                                 width:200
                                             }
                                        ]
                            },

                           {
                          // title:'vigencia',
                           height: 30,
                           columnWidth:.80,
                           layout: 'column',
                           border:false,
                          bodyStyle:'padding:0px 0px 0px 125px',
                            items:[
                                     {
                                         xtype: 'checkbox',
                                           id: 'corporacion_indicadorEstado',
                                           checked:true,
                                            boxLabel: 'Vigente'
                                       }
                                  ]
                         },
                         
                          {
                         // title:'nombre',
                            columnWidth:.100,
                            border:false,
                            layout: 'form',
                            bodyStyle:'padding:2px 2px 2px 2px',
                            labelWidth : 120,
                            colspan:2,
                            items: [
                                     {
                                     xtype: 'textfield',
                                     name:'corporacion_nombreLargo',
                                     fieldLabel:'Nombre',
                                     type: 'string',
                                     width:200
                                     }
                                  ]
                        },
                      {
                          // title:'siglas',
                          columnWidth:.100,
                            border:false,
                            layout: 'form',
                            bodyStyle:'padding:2px 2px 2px 2px',
                            labelWidth : 120,
                            colspan:2,
                            items:[
                           {
                                     xtype: 'textfield',
                                     name:'corporacion_nombreCorto',
                                     fieldLabel:'Siglas',
                                     type: 'string',
                                     width:200
                               }
                                ]
                      },
                      {
                          // title:'direccion',
                          columnWidth:.100,
                            border:false,
                            layout: 'form',
                            bodyStyle:'padding:2px 2px 2px 2px',
                            labelWidth : 120,
                            colspan:2,
                            items:[
                           {
                                     xtype: 'textfield',
                                     name:'corporacion_direccionLegal',
                                     fieldLabel:'Direccion',
                                     type: 'string',
                                     width:200
                               }
                                ]
                      }
               ]
         });
      
      [b]var panelDatosSociedades=new Ext.Panel({
          title:'Datos de las Sociedades',
             height: 200,
             columnWidth:.100,
           // layout: 'table',
           items:[{items:Grid}],
         //  items:[Grid],
       //   model:true,
       //   minimizable:tre,
        //  collapsible:true,
           bbar: {
                          xtype: 'paging',
                          afterPageText: 'de {0}',
                          beforePageText: 'pagina',
                          displayInfo: true,
                          //columnWidth:.100,
                          width:513,
                        items:[{items:Store}]
                      }
         });
      
      var Grid=new Ext.grid.GridPanel({
         //columnWidth:.100,
         title:'mi grid',
         width:513,
         height:200,
         autoWidth:true,
         //items:[{items:Columnas}],
         //items:[{items:Store}]
         columns:Columnas,
         store:Store
       });
      
       var Store =new Ext.data.SimpleStore({
            fields:['idSoc','Razon social','Siglas','Direccion','Representante legal','Nro. RUC'],
            data:[
                  [1,'RazonS1','RS1','dir 1','rep1','123'],
                  [2,'RazonS1','RS1','dir 1','rep1','123'],
                  [3,'RazonS1','RS1','dir 1','rep1','123']
                  ]
            }) ;
       var Columnas=[
                     {   dataIndex:'idSoc',
                         header:'IdSoc.',
                         soportable:true,
                         width:50
                      },
                    {   dataIndex:'Razon Social',
                        header:'Razon Social',
                        soportable:true,
                        width:100  },
                    {dataIndex:'Siglas',
                         header:'Siglas',
                            soportable:true,
                            width:100  },
                    {dataIndex:'Direccion',
                               header:'Direccion',
                               soportable:true,
                               width:100  },
                    {dataIndex:'Representante legal',
                                  header:'Representante legal',
                                  soportable:true,
                                  width:100  },
                    {dataIndex:'Nro. RUC',
                                     header:'Nro. RUC',
                                     soportable:true,
                  width:100  }

                            ];[/b]
      
    </script>


Le pediria porfavor que me puedan ayudar, ya que tengo que ponerlo un boton que almacene esos datos del formulario y lo envie al Grid
Para no ver esta publicidad, debes ser usuario del Foro.
Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)


Cuixer, una forma de administrar páginas web que nunca viste!

Volver a Ext 3.0: Ayuda





  • Publicidad (ayudanos a mantener el Foro haciendo un click sobre la misma)
  • Cuixer, una forma de administrar páginas web que nunca viste!