Search code examples
angularjskendo-uiangular-formly

How to set custom template for kendo-ui multiselect with angular-formly


I was trying to create custom template for multiselect with kedno-ui multiselect and angular-formly. I can get only normal select dropdown field without multisecetion... Here is my example on jsbin


Solution

  • Solved with Configuring app run.

     `app.run(function (formlyConfig) {
        formlyConfig.setType({
            name: 'multiSelect',
            extends: 'select',
            template: '<select kendo-multi-select k-options="" ng-model="model[options.key]" class="form-control" multiple></select>'
        });
    });`
    

    And setting filed like this.

    `vm.fields = [       
      {
        key: 'multiSelect',
        type: 'multiSelect',
        templateOptions: {
          type: 'multiSelect',
          label: 'Fruits',          
          options: data
        }
      },`
    

    You can see example here