Avoiding separators with multicombo (and related controls)

Greetings Webix community!

I’m stumped on how to move forward here, and I would like to seek advice before I commit a large effort into solving this, as I may be missing a simple solution, or I may be re-duplicating a problem that has already been solved.

I’m using a Webix ui.multicombo control inside of a form to allow a user to select multiple options (provided by the server) simultaneously. The user can also begin typing in what they’re looking for, and the back-end forms a query such that it will only display options that match (in the beginning) what they’ve typed. This is tremendously helpful and in initial demos, the users were very pleased with this functionality.

Unfortunately, the options provided by the server may contain any character – from commas, to pipes, to special Unicode characters. I simply cannot trust the options to not contain any character. This creates a problem when using the multicombo control, as it relies on a separator (which is a comma by default). Because I can’t trust the options provided by the server to not contain any character (even super special ones), I don’t think this control could be used without modification.

I’ve looked at the multicombo source code in webix_debug.js, and it looks like the selected options are fundamentally stored as a string, and split out (and later joined) when data manipulation is performed. So because the multicombo stores the values in such a way, I don’t think I could be safe in using this control.

My thoughts are that I would need to copy the multicombo definition, and make my own control which operates similarly, but gets rid of the concept of a separator, and stores the values as an array (or object). I’m just wary to do so, because if the multicombo is improved or a bug has been fixed later on, I may have to back-port these changes to my component which is primarily the same code, just with minor changes.

I was just checking in to see if anyone had any simpler (or more intelligent) solutions, as I’m new to Webix and web programming. Any thoughts on the subject are appreciated.

Regards

Hello,

MultiCombo options can be set as pair of “id” and “value”. Where “id” can be something simpler than “value”. Also you can use a combination of characters as “separator”.