-1
我必須使用兩個組合框,第一個組合框選擇類別,第二個組合框在第一個組合框的類別集內進行搜索。我想將它們打包在一起,成爲一個新的組件(擁有自己的xtype等)。我該怎麼做?如何使用兩個extjs組合框組成一個新的組件?
我必須使用兩個組合框,第一個組合框選擇類別,第二個組合框在第一個組合框的類別集內進行搜索。我想將它們打包在一起,成爲一個新的組件(擁有自己的xtype等)。我該怎麼做?如何使用兩個extjs組合框組成一個新的組件?
Ext.define('DoubleCombo', {
extend: 'Ext.Panel', // or Ext.Component e.t.c
alias: 'widget.doubleCombo',
items: [{
xtype: 'combobox',
...
},{
xtype: 'combobox',
...
}]
});
你可以使用xtype:'doubleCombo'。 查看本指南的組件:http://docs.sencha.com/ext-js/4-1/#!/guide/components
Ext.define('MyApp.view.MyContainer', {
extend: 'Ext.container.Container',
alias:'widget.myxtype',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'combobox',
fieldLabel: 'Label'
},
{
xtype: 'combobox',
fieldLabel: 'Label'
}
]
});
me.callParent(arguments);
}
});