In the kendo-multiselect how to Show “+” icon to add a field

十年热恋 提交于 2019-12-13 03:36:57

问题


In my Angular app, I am using kendo-multiselect. What I am trying to achieve is:

Select a value from dropdown and the click on + icon on the kendo-multiselect and then open a new page (based on the dropdown value).

I have removed the default x icon from the multi-select, using [clearButton]="false", but I am unable to figure out how to show + icon at the same place!


回答1:


You can use the <ng-template kendoMultiSelectGroupTagTemplate let-dataItems> in <kendo-multiselect>.

HTML :

<kendo-multiselect
kendoMultiSelectSummaryTag
[data]="data"
[filterable]="true"
[textField]="textField"
[valueField]="valueField"
[clearButton]="false"
[autoClose]="false"
[value]="selectedValue">
  <ng-template kendoMultiSelectGroupTagTemplate let-dataItems>
    <i class="fas fa-plus-circle fa-lg" (click)="redirectPage(selectedValue)"></i>
  </ng-template>
</kendo-multiselect>

TS :

/** 
 * redirectPage() method is used to redirect into a new component on click of + icon.
 * @param selectedValue {object} - Object of the selected option from the dropdown.
 */
redirectPage(selectedValue) {
  // redirection logic will come here.
}


来源:https://stackoverflow.com/questions/57138397/in-the-kendo-multiselect-how-to-show-icon-to-add-a-field

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!