Available only in PRO Edition
The control is available only in Webix Pro edition.
UI-related Multiselect is a non-editable select control that allows selecting multiple options at a time while displaying them in the dedicated input field.
Multiselect inherits from a standard richselect and has the following features:
{ view:"multiselect", id:"multi", label:"Participant", options:[
{ id:1, value:"Alex Brown" },
{ id:2, value:"Dan Simons" },
{ ... }
], value:"1,3" }
Related sample: Multi-select input
Webix API allows for using another suggest list for the Multiselect - Multisuggest:
webix.ui({
view:"multiselect", suggest:{
view:"multisuggest", data:[
{id:1, value:"one"},
{id:2, value:"two"}
]
}
});
The control's popup is supplied with a "select" button out of box, but it can be changed in two ways:
{view:"multiselect", label:"Participant",options:{
buttonText:"Done",
data:[]
}}
webix.i18n.controls.select = "Done";
webix.i18n.setLocale(); //apply the locale
Then all the Multiselect instances in the app will be supplied with the "Done" word.
You can read more about advanced configuration options for popup selectors in the corresponding documentation article.
Multiselect API allows getting a popup object for further working:
multiselect.getPopup().getBody();
//or
multiselect.getPopup().getList();
If you use multisuggest, then its constituent parts (list and button) are accessed as:
//button object
multiselect.getPopup().getButton();
//list object
multiselect.getPopup().getList();
There is a possibility to select/unselect all options of the Multiselect control.
To enable it, you need to define the selectAll property with the true value in the dedicated suggest object and the corresponding field will be shown on the top of multiselect options:
webix.ui({
view:"multiselect",
options:{
data:[
{ id:1, value:"Alex Brown" },
{ id:2, value:"Dan Simons" },
{ id:3, value:"Gron Alanski" },
{ id:4, value:"Dan Alanski" }
],
selectAll:true
},
value:"1,3"
});
When you click "Select All", all the options are selected and the label changes to Unselect All, which allows you to unselect all the options.
Back to top