custom filter combo

Hi Webix Team

How to do custom filter for combo?

Thanks in advance

Tagged:

Comments

  • edited March 2018

    Hello,

    Try this

    view:"combo",
    options:{
     filter:function(item, value){
        return (item.value.toString().toLowerCase().indexOf(value.toLowerCase()) != -1)
     }
    }
    

    https://docs.webix.com/samples/13_form/01_controls/11_combo_advanced.html

  • edited March 2018

    Hi Nastjs

    thanks for reply, but our requirement is we want to filter the array(how to filter the array in webix)

    please follow the below example

    https://snippet.webix.com/9gjiyoqy

    Thanks in advance

  • Hello @deepak ,

    Could you please clarify in what way the requirements are different from the previous discussion and solutions?

  • edited March 2018

    Hi Listopad

    In below snippet filtering working fine, but
    1)once select the filtering item itz not allowing into combobvox.
    2)after filter if we click the combobox, filtering is leaving

    please follow the below sniipet
    https://snippet.webix.com/5bcbdbc7

  • @deepak the problem here is in a faulty template of suggest. Please note that template is used for rendering value and has to return a string, not an array of an object.

    template:function(obj){
        if (this.config.master){
        var mark = $$(this.config.master).$templateMarker;
        if (mark && obj[mark])
          return obj[mark].join(", ")
        }
        return obj.vf.join(", ")
    },
    
  • edited April 2018

    @Listopad,

    Thanks a lot itz working fine, after filtering the list , the value is allowing into textbox, but if you click again in textbox all the list are displaying in the popup

    please follow the below snippet
    https://snippet.webix.com/06zjl3rx

    thanks in advance

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!