PDA

View Full Version : Editable, multiselect combobox.



VDP
18 Oct 2012, 11:42 PM
I have created a custom component extended from combobox. It has a couple of requirements:

is multiSelect
needs checkboxes
You need to be able to type text and use the checkboxes
Needs filtering after the last ','
output should be the valueField, not the displayField or just the rawValue
when focus is lost (assert) remove duplicates (this one is an easy to implement extra)
As you can see in this fiddle (http://jsfiddle.net/Vandeplas/JAp88/20/) I got quit near. But when I start typing 'Alabama, Alaska', Alabama will automatically select (like it should) after the ',' the filter is cleared and when I start typing Alaska, until Ala, both Alaska and Alabama will be in the list. When I've typed 'Alabama, Alas' the it filters on Alas, so only Alaska will remain. But the issue is the selection got lost and the field got cleared. That's not supposed to happen.

Also: The empty values aren't a big problem (its a deselect and reselect somewhere) but I would like to get rid of the 'null'.

mitchellsimoens
23 Oct 2012, 6:30 AM
As you can see in this fiddle (http://jsfiddle.net/Vandeplas/JAp88/20/) I got quit near. But when I start typing the second word and the first word got filtered away it's cleared.

try typing 'Alabama, Ala' that works type an 's' and it's cleared.

I'm not sure I understand this

VDP
23 Oct 2012, 11:45 PM
I've updated the question