Our blazing fast Grid component built with pure JavaScript


Post by gregc »

i had some free text combos implemented this way:

viewtopic.php?f=43&t=17163&p=85878&hilit=free+text+combo#p85878

These aren't working in 4.2.1 and 4.2.2. You type a bit, click on the list item and tab and it will more often than not leave with the characters you typed instead of the list item you selected.

Last edited by gregc on Wed Aug 04, 2021 1:39 am, edited 1 time in total.

Post by saki »

Can you give us a test case that would demonstrate the problem? The code from the linked post looks correct and should work.


Post by Animal »

It will do that because upon focusout, it uses lastQuery. Which is what you typed.

Look at what is in the combo's input element which is the actual HTML <input>. See if the value in there is in the store. If not, add it.


Post by gregc »

I removed the functionality for now, but I think it is an important feature that should be baked into the standard combo box (being able to free text and add to its list).


Post by mats »

Agree, I've opened a feature request: https://github.com/bryntum/support/issues/3249


Post by gregc »

Any idea if we can get this one today in the next month or two? Otherwise I will need to work on some alternative, thanks!


Post by Animal »

I will get onto this as soon as possible. I've added some notes to the ticket.

We can allow configurable UI gestures to cause the current typed string to create a new record for the store in a definable way. I would suggest a config recordCreater which is a function (or reference to a function - could be the name of a function) which you supply which, when passed the typed value, creates a new record.

In the absence of that, the default would be to just create a new record of the store's type with the displayField set to the string.

The new record will be added to the store and set as the current active item and selected. If the combo is multiSelect, this would add to the value.

If the Combo's Store is an AjaxStore and is configured to sync itself (https://www.bryntum.com/docs/grid/#Core/data/AjaxStore#config-createUrl), it should sync.

Obviously the part about then manipulating your grid would be part of your app. You would listen to data events on the Combo's store to see what's happening to it, and update your UI accordingly.


Post Reply