diff --git a/docs/views/grid/example/Default.vue b/docs/views/grid/example/Default.vue index f587f95d..bb7e74dc 100644 --- a/docs/views/grid/example/Default.vue +++ b/docs/views/grid/example/Default.vue @@ -278,7 +278,7 @@ export default { }, ]); const columns = ref([ - { caption: 'Name', field: 'userName', type: 'string', width: 80 }, + { caption: 'Name', field: 'userName', type: 'string', width: 80, fixed: true }, { caption: 'Role', field: 'role', type: 'string', width: 80, hiddenDisplay: true }, { caption: 'number', field: 'number', type: 'number', width: 80 }, { caption: 'boolean', field: 'boolean', type: 'boolean', width: 80 }, diff --git a/src/components/grid/GridColumnSetting.vue b/src/components/grid/GridColumnSetting.vue index 992f33a2..315e016d 100644 --- a/src/components/grid/GridColumnSetting.vue +++ b/src/components/grid/GridColumnSetting.vue @@ -26,6 +26,7 @@ v-for="(column, idx) in columnList" :key="`column_${idx}`" :label="column?.text" + :disabled="!!column?.fixed" :tooltip-title="column?.label ?? ''" > {{ column?.label }} @@ -210,6 +211,7 @@ export default { text: col.field, originChecked: !col.hiddenDisplay, checked: isChecked, + fixed: col.fixed, }; }); diff --git a/src/components/grid/uses.js b/src/components/grid/uses.js index e7c16091..55174670 100644 --- a/src/components/grid/uses.js +++ b/src/components/grid/uses.js @@ -1185,7 +1185,7 @@ export const contextMenuEvent = (params) => { { text: contextInfo.columnMenuTextInfo?.hide ?? 'Hide', iconClass: 'ev-icon-visibility-off', - disabled: !useGridSetting.value || stores.orderedColumns.length === 1, + disabled: (!useGridSetting.value || stores.orderedColumns.length === 1) || column.fixed, hidden: contextInfo.hiddenColumnMenuItem?.hide, click: () => { setColumnHidden(column.field);