Available only in PRO Edition
The control is available only in Webix Pro edition.
UI-related multitext is a dynamic control based on standard Webix text input. It offers the possibility to add and delete additional fields on the go.
{
view:"multitext",
id:"multi",
value:"dummy@email.com",
label:"Email"
}
Related sample: Multi-Text input
Each field of a multitext control features its own ID. It can be either a given (for the basic field) or an auto-generated one. All the methods of a multitext object can be applied to any field object.
New fields are added at the bottom of Multitext parent layout. However, if you will create some other view after the Multitext one, new rows will be added after this view.
In order to add new fields in the correct way, you should place the Multitext view into a separate layout:
webix.ui({
view:"form",
elements: [
{
rows:[
{view:"multitext", name:"multitext1", label:"Multitext"}
]
},
{view:"text",name:"newinput",label:"Text Input",width:270},
]
});
With such a configuration, each new field will appear after the previously added one.
Additional fields inherit configuration from the main one. In order to define common settings for all additional fields, state it in the subConfig object:
webix.ui({
rows:[
{view:"multitext",
value:'99999, number',
label:"Custom" ,
pattern:{mask:"###-## ########"},
attributes:{ maxlength:10 },
subConfig:{
pattern:{mask:"###-##-##"},
attributes:{ maxlength:10 }
}}
]
});
In case of dynamic configuration, handle onSectionAdd event.
Detailed information on formatting text inputs you can find in the related article.
Multitext API allows adding and removing additional fields dynamically:
var newFieldId = $$("multi").addSection();
// remove specific field
$$("multi").remove(newFieldId);
// remove all the additional fields
$$("multi").remove();
Notes:
Multitext features an extended API for setting and getting its values.