Threaded View
-
3 May 2011 10:29 PM #1
ComboBox using Grid instead of BoundList
ComboBox using Grid instead of BoundList
It would be nice to use a Grid instead of simple BoundList to render the ComboBox picker. This is currently not possible.
I currently use the following code to implement that feature. Maybe it is possible to integrate that into the standard ComboBox in future releases?
Code: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, { itemclick: me.onItemClick, refresh: me.onListRefresh, scope: me }); me.mon(picker.getSelectionModel(), { selectionChange: me.onListSelectionChange, scope: me }); return picker; } });
Looks like we can't reproduce the issue or there's a problem in the test case provided.
Similar Threads
-
[CLOSED] [1.2.3] Problem using ComboBox as an editor in the grid
By micgala in forum Ext GWT: Bugs (1.x)Replies: 3Last Post: 9 May 2011, 1:23 AM -
[CLOSED] Combobox in GXT 2.1
By amotamed in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 6 Jan 2010, 5:06 AM -
[OPEN] [2.2][DUP][CLOSED] ComboBox in IE
By JamesMa in forum Ext 2.x: BugsReplies: 3Last Post: 28 Sep 2008, 4:28 AM -
[2.0b1][DUP][CLOSED] ComboBox listWidth not matching ComboBox width
By christocracy in forum Ext 2.x: BugsReplies: 2Last Post: 20 Oct 2007, 7:50 AM


Reply With Quote