2016-05-25 4 views
0

я пытаюсь добавить это к панели, но я не знаю, как:ExtJS 4.2 - Как добавить таблицу в панель?

enter image description here

Это таблица и контейнер представляет собой панель, и я не знаю, как это сделать в ExtJS 4.2, потому что ближайшая вещь - это сетка, но мне не нужна сетка.

+0

Вы всегда можете поместить HTML в [ 'html' собственности] (http://docs.sencha.com /extjs/4.2.2/#!/api/Ext.panel.Panel-cfg-html). – Alexander

+0

Я пытаюсь, но пустые ячейки содержат динамические данные – SensacionRC

+0

Что вы хотите достичь, и то, что вы пробовали, должно быть частью вашего вопроса. – Alexander

ответ

0

Наконец-то я решил это с помощью панели формы. Вот код:

var tabla=new Ext.form.Panel({ 
    bodyPadding: '0 0 0 0', 
    margin:'0 5 0 5', 
    bodyStyle: 'background-color:#f1f1f1;', 
    border:0, 
    items: [ 
      { 
       xtype: 'container', 
       anchor: '100%', 
       layout: 'hbox', 
       items:[ 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             labelAlign: 'top', 
             labelSeparator: '', 
             fieldLabel: '--', 
             labelStyle: 'text-align: center;color:#f1f1f1;background-color:#f1f1f1;', 
             height:104, 
             fieldStyle: 'text-align: center;', 
             value:'NUEVO' 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             labelAlign: 'top', 
             labelSeparator: '', 
             fieldLabel: '--', 
             labelStyle: 'text-align: center;color:#f1f1f1;background-color:#f1f1f1;', 
             fieldStyle: 'text-align: center;', 
             value:'GANADO', 
             height:44 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: center;', 
             value:'PERDIDO', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: center;', 
             value:'PENDIENTE', 
             height:30 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             anchor:'100%', 
             labelAlign: 'top', 
             labelSeparator: '', 
             fieldLabel: 'VIGOR', 
             labelStyle: 'text-align: center;background-color:#f1f1f1;', 
             readOnly:true, 
             fieldStyle: 'text-align: right;', 
             height:44 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'200%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             anchor:'100%', 
             labelAlign: 'top', 
             labelSeparator: '', 
             fieldLabel: 'VENCIDO', 
             labelStyle: 'text-align: center;background-color:#f1f1f1;', 
             readOnly:true, 
             fieldStyle: 'text-align: right;', 
             height:44 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            } 
          ] 
         } 
       ] 
      }, 
      { 
       xtype: 'container', 
       margin:'-5 0 0 0', 
       anchor: '100%', 
       layout: 'hbox', 
       items:[ 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             height:90, 
             fieldStyle: 'text-align: center;', 
             value:'MANTENIMIENTO' 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             value:'GANADO', 
             fieldStyle: 'text-align: center;', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: center;', 
             value:'PERDIDO', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: center;', 
             value:'PENDIENTE', 
             height:30 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'200%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            } 
          ] 
         }, 
         { 
          xtype: 'container', 
          flex: 1, 
          layout: 'anchor', 
          items:[ 
            { 
             xtype:'textfield', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            }, 
            { 
             xtype:'textfield', 
             margin:'-5 0 0 0', 
             readOnly:true, 
             anchor:'100%', 
             fieldStyle: 'text-align: right;', 
             height:30 
            } 
          ] 
         } 
       ] 
      } 
    ] 
}); 

И это образ результата: enter image description here

Смежные вопросы