Hi,
I have this grid markup with auto generated columns by ngFor. Also I have checkbox column. But I need to make checkbox by default sticky (locked) and this will throw error.
Thank you for your time.
I have this grid markup with auto generated columns by ngFor. Also I have checkbox column. But I need to make checkbox by default sticky (locked) and this will throw error.
Thank you for your time.
GridComponent.html:5 ERROR Error: There should be at least one non-locked column
at GridComponent.verifySettings (index.js:7712)
at GridComponent.ngAfterContentChecked (index.js:6992)
at callProviderLifecycles (core.js:24917)
at callElementProvidersLifecycles (core.js:24886)
at callLifecycleHooksChildrenFirst (core.js:24868)
at checkAndUpdateView (core.js:35072)
at callViewAction (core.js:35433)
at execComponentViewsAction (core.js:35361)
at checkAndUpdateView (core.js:35074)
at callViewAction (core.js:35433)
<!-- Checkbox -->
<kendo-grid-checkbox-column
[width]="checkboxColumnSize"
[style]="{ 'text-align': 'center' }"
Error -> [locked]="true" or [sticky]="true
>
<ng-template kendoGridHeaderTemplate>
<!-- Columns Menu -->
<ca-toggle-popup
class="grid-columns-menu"
#showColumnsMenu
(toggle)="onShowColumnsMenu($event)"
>
<button
button
kendoButton
class="columns-menu-button"
iconClass="fal fa-cog"
look="clear"
kendoTooltip
position="right"
title="Settings"
></button>
<div popup>
<div class="columns-menu-header">
<span>Grid Columns</span>
</div>
<ca-switch-lists
#switchColumns
[keyField]="'field'"
[textField]="'title'"
[maxSelected]="maxSwitchColumns"
[availableData]="availableColumns"
[selectedData]="selectedColumns"
class="columns-menu-switchlist"
></ca-switch-lists>
<div class="columns-menu-actions">
<button
kendoButton
(click)="onCancelColumnsMenu(showColumnsMenu)"
>
Cancel
</button>
<button
kendoButton
[primary]="true"
(click)="
onApplyColumnsMenu(
showColumnsMenu,
switchColumns.selectedData
)
"
[disabled]="!switchColumns.selectedData?.length"
>
Apply ({{ switchColumns.selectedData?.length || 0 }}/{{
maxSwitchColumns
}})
</button>
</div>
</div>
</ca-toggle-popup>
</ng-template>
</kendo-grid-checkbox-column>
<!-- Columns -->
<kendo-grid-column
*ngFor="let column of columns; let i = index"
[field]="column.field"
[title]="column.title"
[width]="getColumnWidth | apply: i:column.field:defaultColumnSize"
[filter]="filterColumn | apply: column.type"
[locked]="lockColumn | apply: column.field"
[style]="{
'min-width': minColumnSize + 'px',
'max-width': maxColumnSize + 'px'
}"
>
<!-- Column Header -->
<ng-template kendoGridHeaderTemplate let-column>
<!-- Cell Value -->
<span class="k-flex">{{ column.title }}</span>
<!-- Cell Menu -->
<kendo-grid-column-menu
*ngIf="!hasMore"
[column]="column"
[sort]="state.sort"
[filter]="state.filter"
[settings]="{
sort: true,
filter: true,
lock: true,
columnChooser: false
}"
>
</kendo-grid-column-menu>
</ng-template>
<!-- Cell Item -->
<ng-template kendoGridCellTemplate let-dataItem>
<span class="grid-cell">{{
editCell | apply: column:dataItem[column.field]
}}</span>
</ng-template>
</kendo-grid-column>