Multicombo limit selection

Hello,

How can we configure a limit on the number of items selected inside the multicombo component?

We want the users to be able to select only X number of items.

Thanks!

Hello,

For such task, you can use onChange event and reverse the value:

http://webix.com/snippet/caca73ed

Thank you!

I have another question:

  • how can I add a tooltip for each of the option values? (sometimes the options width is larger than the multicombo width)

There’s a possibility to define it in the inner list (body) of multisuggest:

  options:{    
    body:{
      data:list_data,
      tooltip:function(obj){
        return obj.value
      }
    }
  }

But regarding the configuration of this list, please note (just in case) that all list-related events should be set through

multicombo.getList().attachEvent(/* ... */)

due to the limitation of the component: the on handler ofbody souldn’t be redefined.

Thanks!

Will it be also possible to set the option template using this workflow?
e.g. add an icon before each item (i.e. setting template)

Sure, as the template can return any HTML string to render.

For example http://webix.com/snippet/13e166bb

Wow, it looks great, Thanks!