这是我正在使用的代码,在许多方面尝试过,比如使用占位符标签,但没有任何结果。帮我
<kendo-grid-column field="food" title="foods">
<ng-template kendoGridFilterCellTemplate let-filter let-column="column">
<kendo-grid-string-filter-cell
[showOperators]="false"
[column]="column"
[filter]="filter">
</kendo-grid-string-filter-cell>
我不是100%肯定你的问题。我正在使用Vue,但是这里是通过设置noRecords
属性在没有记录时设置占位符文本的方法。
<kendo-grid ref="gridComponent"
...
:no-records="noRecords"
...
v-on:change="rowSelected"
:sort="sortFilter">
在Vue中,noRecords
是一个反应数据字段,定义如下:
data () {
return {
noRecords: {
template: '<br /><br/> Please start typing a Policy Number, Insured Name, or Address to show results <br /><br /><br />'
}
}
根据我的理解,没有解决方案在kendo-UI> kendo-grid-string-filter-cell中编写默认占位符。
我和你有同样的问题,我找不到一个简单的方法来做到这一点。我能想到实现这一目标的唯一方法如下:
1)从Kendo创建一个可重用的自定义过滤器组件 - > https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/
2)然后添加一个TextArea输入作为你的过滤器输入,并有floatLabel html元素,以便像占位符一样使用它。
@Component({
selector: 'my-app',
template: `
<kendo-textbox-container floatingLabel="First name">
<textarea kendoTextArea></textarea>
</kendo-textbox-container>
`
我无法通过使用Kendo UI提供的内置过滤器模板找到一种方法。
我现在尝试这种方法
只需将这段代码放在组件文件中即可
public placeHolders(){
$(".k-textbox").eq(0).attr("placeholder", "column 1");
$(".k-textbox").eq(1).attr("placeholder", "column 2");
$(".k-textbox").eq(2).attr("placeholder", "column 3");
}