Correct one problem about grid instead of BoundList, when we click the grid combo box first time, it can't show all the items, it is because combo box refresh doesn't call, since we need listen the 'refresh' event in grid view instead of grid panel.
the test environment is extjs4 and chrome.


Ext.define('PVE.form.ComboGrid', { extend: 'Ext.form.ComboBox', requires: [ 'Ext.grid.Panel' ], alias: ['widget.PVE.form.ComboGrid'], // copied from ComboBox createPicker: function() { var me = this, picker, menuCls = Ext.baseCSSPrefix + 'menu', opts = Ext.apply({ selModel: { mode: me.multiSelect ? 'SIMPLE' : 'SINGLE' }, floating: true, hidden: true, ownerCt: me.ownerCt, cls: me.el.up('.' + menuCls) ? menuCls : '', store: me.store, displayField: me.displayField, focusOnToFront: false, pageSize: me.pageSize }, me.listConfig, me.defaultListConfig); // NOTE: we simply use a grid panel //picker = me.picker = Ext.create('Ext.view.BoundList', opts); picker = me.picker = Ext.create('Ext.grid.Panel', opts); // hack: pass getNode() to the view picker.getNode = function() { picker.getView().getNode(arguments); };
me.mon(picker.getView(), {
refresh: me.onListRefresh,
scope:me
});
me.mon(picker, { itemclick: me.onItemClick,// refresh: me.onListRefresh, scope: me }); me.mon(picker.getSelectionModel(), { selectionChange: me.onListSelectionChange, scope: me }); return picker; }});