最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Extjs Creating a tagfield without the list - Stack Overflow

matteradmin6PV0评论

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 bination 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 bobox 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?

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 bination 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 bobox 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?

Share Improve this question asked Apr 29, 2015 at 12:59 PentaKonPentaKon 4,6566 gold badges49 silver badges84 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

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/mmvg1bL2/

there's also triggerOnClick boolean config option (6.0.1, 5.1.2) which achieves the same; also to be used with hideTrigger: true

Post a comment

comment list (0)

  1. No comments so far