Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs Creating a tagfield without the list

I know this might not be the way it was intended to be used, but I'm going to ask anyway:

Is there a way to create a tagfield without the drop down list?

What we have is a custom control which is a combination of a tagfield and an itemSelector. The itemSelector is inside a panel which appears via a toggle button. After we have selected some values, we hide the panel and those values get selected in the tagfield. We are essentially not using the tagfield's combobox properties, but we want to keep the ability to remove any records by pressing the "x" beside the records. Is there a configuration or other way to block the tagfield from showing the drop down list when it is clicked?

like image 535
PentaKon Avatar asked Apr 29 '15 12:04

PentaKon


1 Answers

IMO easiest way is to override extend method (it might be empty) and set hideTrigger to true:

{
    xtype: 'tagfield',
    store: store,
    expand: Ext.emptyFn,
    hideTrigger: true
}

Fiddle: http://jsfiddle.net/mmvg1bL2/

like image 130
Krzysztof Avatar answered Nov 13 '22 08:11

Krzysztof