TreePicker.js (1529B)
1 Ext.define("PartKeepr.Widgets.TreePicker", { 2 extend: "Ext.ux.TreePicker", 3 4 /** 5 * Creates and returns the tree panel to be used as this field's picker. 6 */ 7 createPicker: function() { 8 var me = this, 9 picker = new Ext.tree.Panel({ 10 baseCls: Ext.baseCSSPrefix + 'boundlist', 11 shrinkWrapDock: 2, 12 store: me.store, 13 floating: true, 14 displayField: me.displayField, 15 columns: me.columns, 16 minHeight: me.minPickerHeight, 17 maxHeight: me.maxPickerHeight, 18 manageHeight: false, 19 shadow: false, 20 rootVisible: false, 21 listeners: { 22 scope: me, 23 itemclick: me.onItemClick 24 } 25 }), 26 view = picker.getView(); 27 28 if (Ext.isIE9 && Ext.isStrict) { 29 // In IE9 strict mode, the tree view grows by the height of the horizontal scroll bar when the items are highlighted or unhighlighted. 30 // Also when items are collapsed or expanded the height of the view is off. Forcing a repaint fixes the problem. 31 view.on({ 32 scope: me, 33 highlightitem: me.repaintPickerView, 34 unhighlightitem: me.repaintPickerView, 35 afteritemexpand: me.repaintPickerView, 36 afteritemcollapse: me.repaintPickerView 37 }); 38 } 39 return picker; 40 } 41 });