2014-10-13 5 views
0

Я использую ExtJS5 и пытаюсь поместить элементы объекта на панель карты для функции, которую пользователь может изменить панель при щелчке по дереву. Но я не знаю, правильно ли это сделать.extjs Как сменить панель с помощью treepanel

var p = Ext.create('Ext.panel.Panel', { 
    layout: 'card', 
    items: [ 
     grid, bottompanel 
    ] 
}); 

Мне нравится делать это как Example

А вот панель с правой стороны.

var grid = Ext.create('Ext.grid.Panel', { 
    //title: 'Simpsons', 
    title: 'Customers', 
    height: 300, 
    width:'100%', 
    id: 'cus_grid', 
    columns: [ 
     {text: "Customer ID", dataIndex: "id", flex: 1}, 
     {text: "Customer Name", dataIndex: "name", flex: 1}, 
     {text: "Services Name", dataIndex: "s_name", flex: 1}, 
     {text: "Services Type", dataIndex: "s_type", flex: 1} 
    ], 
    store: user, 
    listeners : { 
     itemclick: function(dv, record, item, index, e) { 
      //alert(record.get('name')); 
      Ext.getCmp('infoForm').getForm().findField('id').setReadOnly(true); 
      Ext.getCmp('infoForm').getForm().findField('s_type').setReadOnly(true); 
      Ext.getCmp('infoForm').loadRecord(record);   
     } 
    } 
}); 

var bottompanel = Ext.create('Ext.form.Panel', { 
    //region: 'center', 
    title: 'Information', 
    bodyPadding: 10, 
    flex:1, 
    width:'100%', 
    id: 'infoForm', 
    items: [{ 
       xtype: 'textfield', 
       name: 'id', 
       fieldLabel: 'Customer ID', 
       allowBlank: false // requires a non-empty value 
      },{ 
       xtype: 'textfield', 
       name: 'name', 
       fieldLabel: 'Name', 
       allowBlank: false // requires a non-empty value 
      }, { 
       xtype: 'textfield', 
       name: 's_name', 
       fieldLabel: 'Services Name', 
       allowBlank: false // requires a non-empty value 
      }, cmbBox], 
      // Reset and Submit buttons 
      buttons: [], 
      tbar: toolBar 
}); 

спасибо.

ответ

0

я исправил проблему ....

Я забыл добавить ширину в панели карты так есть ошибка произошла.

спасибо.

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