如何在Kendo ComboBox中添加工具提示?

huangapple go评论73阅读模式
英文:

How to add tooltip in kendo combobox?

问题

请检查StackBlitz项目,并建议如何向下拉菜单添加工具提示,以便我能够在StackBlitz项目中看到有关“Small”,“Medium”和“Large”下拉菜单的工具提示。

英文:

Check StackBlitz project and suggest how to add tooltips to the dropdown, so that I am able to see tooltips for 'Small,' 'Medium,' and 'Large' dropdowns which is mentioned in StackBlitz project?

答案1

得分: 2

您可以为组合框的项目定义一个模板,具体为 kendoComboBoxItemTemplate

将以下内容放入您的组合框中:

<kendo-combobox [allowCustom]="true"
                [data]="data"
                [textField]="'text'"
                [valueField]="'value'"
                [filterable]="true"
                (filterChange)="handleFilter($event)"
                [placeholder]="'T-shirt size'">
    <ng-template kendoComboBoxItemTemplate let-dataItem>
        <div [title]="dataItem.text">{{dataItem.text}}</div>
    </ng-template>
</kendo-combobox>

您可以在 title 属性中放入任何您想要或需要的内容,以用作工具提示。

英文:

You can define a template for the items of the combobox, specifically kendoComboBoxItemTemplate.

Place the following inside your combobox:

&lt;kendo-combobox [allowCustom]=&quot;true&quot;
                [data]=&quot;data&quot;
                [textField]=&quot;&#39;text&#39;&quot;
                [valueField]=&quot;&#39;value&#39;&quot;
                [filterable]=&quot;true&quot;
                (filterChange)=&quot;handleFilter($event)&quot;
                [placeholder]=&quot;&#39;T-shirt size&#39;&quot;&gt;
    &lt;ng-template kendoComboBoxItemTemplate let-dataItem&gt;
        &lt;div [title]=&quot;dataItem.text&quot;&gt;{{dataItem.text}}&lt;/div&gt;
    &lt;/ng-template&gt;
&lt;/kendo-combobox&gt;

You can place anything you want or need in the title attribute to serve as a tooltip.

huangapple
  • 本文由 发表于 2023年6月12日 23:46:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76458286.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定