kendo-toolbar-dropdownbutton 在 kendoGridToolbarTemplate Angular 7 中不起作用
kendo-toolbar-dropdownbutton not working in kendoGridToolbarTemplate Angular 7
我想在 kendoGridToolbarTemplate
中使用 kendo-toolbar-dropdownbutton
。除了 kendo-toolbar-dropdownbutton
之外的所有其他内容都按预期显示。
<ng-template kendoGridToolbarTemplate>
<div class="col-xs-12 col-md-3 col-lg-3 col-xl-3 example-col" style="padding: 0 !important;">
<button aria-label="New" kendoGridAddCommand [disabled]="isInEditingMode || isUpdateLoading || !isGDPRApproved || (!isTemplate && !isAllowedToUpdate && !isNewAPForm) || (!isTemplate && !isAllowedToCreate && isNewAPForm) || (isTemplate && !isAllowedToUpdateExpensesTemplates && !isNewAPForm) || (isTemplate && !isAllowedToCreateExpensesTemplates && isNewAPForm)"><span class="k-icon k-i-plus-circle"></span>{{lbl_New}}</button>
<button aria-label="Cancel" *ngIf="isInEditingMode" (click)="cancelGridEdit()" class="k-button k-primary">{{lbl_Cancel}}</button>
<kendo-toolbar-dropdownbutton [text]="lbl_Actions"
[icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
</kendo-toolbar-dropdownbutton>
<button aria-label="Excel" type="button" kendoGridExcelCommand [disabled]="isUpdateLoading"><span class="k-icon k-i-file-excel"></span>{{lbl_ExportToExcel}}</button>
<button aria-label="PDF" kendoGridPDFCommand [disabled]="isUpdateLoading"><span class='k-icon k-i-file-pdf'></span>{{lbl_ExportToPdf}}</button>
<button aria-label="saveCurrentGridLinesState" class="k-button" [disabled]="isUpdateLoading" (click)="saveCurrentGridLinesState()">{{lbl_SaveCurrentView}}</button>
<button aria-label="LoadSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="loadSavedGridLinesState()">{{lbl_LoadSavedView}}</button>
<button aria-label="RemoveSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="removeSavedGridLinesState()">{{lbl_RemoveSavedView}}</button>
<button aria-label="ClearSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="clearSavedGridLinesState()">{{lbl_ClearView}}</button>
</div>
<div class="col-xs-12 col-md-9 col-lg-9 col-xl-9 row example-config" style="float: right; padding: 0 !important;">
<div *ngFor="let column of columns" class="col-xs-12 col-md-3 col-lg-2 col-xl-2 checkbox-col" style="width: 8.09%">
<input type="checkbox"
id="{{column.field}}"
class="k-checkbox"
[disabled]="isDisabled(column.field)"
[checked]="!isHidden(column.field)"
(change)="hideColumn(column.field)" />
<label class="k-checkbox-label" for="{{column.field}}">{{column.title}}</label>
</div>
</div>
</ng-template>
控制台没有出现错误。然而 kendo-toolbar-dropdownbutton
从未出现。
如果我使用 kendo-dropdownbutton
而不是 kendo-toolbar-dropdownbutton
<kendo-dropdownbutton [text]="lbl_Actions"
[icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
</kendo-dropdownbutton>
我收到错误
compiler.js:2430 Uncaught Error: Template parse errors:
Can't bind to 'text' since it isn't a known property of 'kendo-dropdownbutton'.
1. If 'kendo-dropdownbutton' is an Angular component and it has 'text' input, then verify that it is part of this module.
2. If 'kendo-dropdownbutton' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
所有 Kendo 模块(例如 GridModule、ButtonsModule 等)都已正确导入。
请告诉我如何解决此问题或找到使用它的解决方法。提前谢谢你。
我找到了解决方案。
而不是 kendo-toolbar-dropdownbutton
我应该使用 kendo-dropdownbutton
我的问题中提到的。然而,text
是 而不是 kendo-dropdownbutton
的输入。它只存在于 kendo-toolbar-dropdownbutton
。这就是出现错误的原因。
所以,实际答案是:
<kendo-dropdownbutton [icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
{{lbl_Actions}}
</kendo-dropdownbutton>
我想在 kendoGridToolbarTemplate
中使用 kendo-toolbar-dropdownbutton
。除了 kendo-toolbar-dropdownbutton
之外的所有其他内容都按预期显示。
<ng-template kendoGridToolbarTemplate>
<div class="col-xs-12 col-md-3 col-lg-3 col-xl-3 example-col" style="padding: 0 !important;">
<button aria-label="New" kendoGridAddCommand [disabled]="isInEditingMode || isUpdateLoading || !isGDPRApproved || (!isTemplate && !isAllowedToUpdate && !isNewAPForm) || (!isTemplate && !isAllowedToCreate && isNewAPForm) || (isTemplate && !isAllowedToUpdateExpensesTemplates && !isNewAPForm) || (isTemplate && !isAllowedToCreateExpensesTemplates && isNewAPForm)"><span class="k-icon k-i-plus-circle"></span>{{lbl_New}}</button>
<button aria-label="Cancel" *ngIf="isInEditingMode" (click)="cancelGridEdit()" class="k-button k-primary">{{lbl_Cancel}}</button>
<kendo-toolbar-dropdownbutton [text]="lbl_Actions"
[icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
</kendo-toolbar-dropdownbutton>
<button aria-label="Excel" type="button" kendoGridExcelCommand [disabled]="isUpdateLoading"><span class="k-icon k-i-file-excel"></span>{{lbl_ExportToExcel}}</button>
<button aria-label="PDF" kendoGridPDFCommand [disabled]="isUpdateLoading"><span class='k-icon k-i-file-pdf'></span>{{lbl_ExportToPdf}}</button>
<button aria-label="saveCurrentGridLinesState" class="k-button" [disabled]="isUpdateLoading" (click)="saveCurrentGridLinesState()">{{lbl_SaveCurrentView}}</button>
<button aria-label="LoadSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="loadSavedGridLinesState()">{{lbl_LoadSavedView}}</button>
<button aria-label="RemoveSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="removeSavedGridLinesState()">{{lbl_RemoveSavedView}}</button>
<button aria-label="ClearSavedGridLinesState" class="k-button" *ngIf="savedGridLinesStateAPsExists" [disabled]="isUpdateLoading" (click)="clearSavedGridLinesState()">{{lbl_ClearView}}</button>
</div>
<div class="col-xs-12 col-md-9 col-lg-9 col-xl-9 row example-config" style="float: right; padding: 0 !important;">
<div *ngFor="let column of columns" class="col-xs-12 col-md-3 col-lg-2 col-xl-2 checkbox-col" style="width: 8.09%">
<input type="checkbox"
id="{{column.field}}"
class="k-checkbox"
[disabled]="isDisabled(column.field)"
[checked]="!isHidden(column.field)"
(change)="hideColumn(column.field)" />
<label class="k-checkbox-label" for="{{column.field}}">{{column.title}}</label>
</div>
</div>
</ng-template>
控制台没有出现错误。然而 kendo-toolbar-dropdownbutton
从未出现。
如果我使用 kendo-dropdownbutton
kendo-toolbar-dropdownbutton
<kendo-dropdownbutton [text]="lbl_Actions"
[icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
</kendo-dropdownbutton>
我收到错误
compiler.js:2430 Uncaught Error: Template parse errors:
Can't bind to 'text' since it isn't a known property of 'kendo-dropdownbutton'.
1. If 'kendo-dropdownbutton' is an Angular component and it has 'text' input, then verify that it is part of this module.
2. If 'kendo-dropdownbutton' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
所有 Kendo 模块(例如 GridModule、ButtonsModule 等)都已正确导入。
请告诉我如何解决此问题或找到使用它的解决方法。提前谢谢你。
我找到了解决方案。
而不是 kendo-toolbar-dropdownbutton
我应该使用 kendo-dropdownbutton
我的问题中提到的。然而,text
是 而不是 kendo-dropdownbutton
的输入。它只存在于 kendo-toolbar-dropdownbutton
。这就是出现错误的原因。
所以,实际答案是:
<kendo-dropdownbutton [icon]="'grid-layout'"
[disabled]="isUpdateLoading"
[data]="dropdownButtonDataLines">
{{lbl_Actions}}
</kendo-dropdownbutton>