Available only in PRO Edition
The functionality is a feature of Webix Pro edition.
DataView suggest, or DataSuggest, is used to add extra functionality to Webix select controls, namely richselect, multiselect, combo, multicombo and similar editors. It is based on Webix suggest list.
DataSuggest extension makes it possible to use Webix DataView in a dropdown menu which is great for inserting pictures while by default Webix list is used.
The extension can be used to redefine dropdown menu of select controls.
Default combo and richselect constructor looks as follows:
{
view:"combo", //or "richselect"
value:1,
options:[...] //options data
}
When extended with DataSuggest, the constructor allows setting Webix DataView for a dropdown menu and defining its configuration right among the component's options.
{ view:"richselect", value:1, options:{
view:"datasuggest",
data:options
}},
Possible configuration parameters:
Predefined Input Template
{ view:"richselect", options:{
view:"datasuggest",
template:"#value# (#color#)",
data:options
}}
Body allows for setting the following parameters for a dropdown DataView:
Item template, predefined item dimensions
{ view:"richselect", options:{
view:"datasuggest",
body:{
template:function(obj){
return obj.value + "</br><img src='data/image00"+obj.id+".jpg'>";
},
type:{
width:270, height:180
},
data:options
}
}}
DataSuggest can be used as a component editor as part of combo or richselect editors.
For these needs, a popup should be previously initialized, either with default or with customized settings:
Default - that's enough
var popup = webix.ui({
view:"datasuggest"
});
With the custom configuration all the above-mentioned settings can be used:
Customized
var popup = webix.ui({
view:"datasuggest",
body:{
type:{
height:100,
width:160
},
template:"<b>#value#</b><br>#year#"
}
});
Then, this popup should be attached to the column in question with the help of its popup property:
{ id:"title", editor:"richselect", collection:options, popup:popup }
Related sample: Dataselect Editor