ui select angularjs set maxlength for input value (ui select match)

后端 未结 3 1303
刺人心
刺人心 2021-01-25 07:26

I want an extra attribute just like \"Placeholder\" is passing from ui select match. I want to set maxlength of select input. I can set it through select.min.js adding attribute

3条回答
  •  执笔经年
    2021-01-25 07:49

    As per my understanding, you are using ui-select with tagging (as combo-box).

    in this to achieve your desired functionality:

    go to ui-select plugin.js and edit the template "select2/select.tpl.html" (for theme select2):

    ng-attr-maxlength="{{$select.tagging.isActivated ? 50 : ''}}"

    add the above line to template as shown here:

    
    

    if you want to restrict input search itself then directly add maxlength attribute:

    
    

    Hope this helps. :-)

提交回复
热议问题