PDA

View Full Version : [CLOSED] ExtJS 4.2 TreePicker needs doubleclick to trigger 2nd time



docuvita
11 Apr 2013, 2:37 AM
Hello,

After selecting a record in the TreePicker, you have to click twice before the picker shows up again, but only in case of not loosing focus. (use example below to reproduce)



Ext.require([
'Ext.form.*', 'Ext.data.*', 'Ext.ux.TreePicker'
]);


Ext.onReady(function() {
var data={
"id": 5,
"values": "test5",
"children": [{
"id": 0,
"values": "test4",
"children": [{
"id": 1,
"values": "test3",
"leaf": true,
"children": []
},{
"id": 2,
"values": "test2",
"leaf": true,
"children": []
}]
},{
"id": 3,
"values": "test1",
"leaf": true,
"children": []
}]
};
var store = Ext.create('Ext.data.TreeStore', {
fields: [{name: 'values', type: 'object'}],
root: data


});


// Form
// -----------------------------------------------------------------------
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
//bodyStyle: 'padding: 5px 5px 0 5px;',
width:400,
layout:'fit',
items: [{
xtype:'treepicker',
store: store,
displayField: 'values',
fieldLabel:'TestPicker',
name: 'testpicker'
}]
});
});


Am i missing something?

slemmon
11 Apr 2013, 6:52 AM
*Thread moved to Ext:Bugs
Thanks for the report! I have opened a bug in our bug tracker.

Kyle2123
20 Apr 2013, 10:44 AM
Can fix with an override -


Ext.override(Ext.ux.TreePicker,
{
selectItem : function(record)
{
var me = this;
me.setValue(record.getId());
//me.picker.hide();
me.collapse();
me.inputEl.focus();
me.fireEvent('select', me, record);
}
});