Cell edit improvements
parent
25ec783ce4
commit
9ba8911b6c
|
@ -83,12 +83,11 @@ export default {
|
||||||
this.children = this.$children;
|
this.children = this.$children;
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (this.d_editing) {
|
let query = this.editMode === 'row' ? '[autofocus]' : 'input';
|
||||||
let focusable = DomHandler.findSingle(this.$el, 'input');
|
let focusable = DomHandler.findSingle(this.$el, query);
|
||||||
if (focusable) {
|
if (focusable && document.activeElement != focusable) {
|
||||||
focusable.focus();
|
focusable.focus();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resolveFieldData() {
|
resolveFieldData() {
|
||||||
|
|
|
@ -1963,11 +1963,6 @@ export default {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Edit */
|
|
||||||
.p-datatable .p-datatable-tbody > tr > td.p-cell-editing .p-component {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-datatable .p-row-editor-init,
|
.p-datatable .p-row-editor-init,
|
||||||
.p-datatable .p-row-editor-save,
|
.p-datatable .p-row-editor-save,
|
||||||
.p-datatable .p-row-editor-cancel {
|
.p-datatable .p-row-editor-cancel {
|
||||||
|
|
|
@ -1116,7 +1116,7 @@ export default {
|
||||||
<Column field="vin" header="Vin"></Column>
|
<Column field="vin" header="Vin"></Column>
|
||||||
<Column field="year" header="Year">
|
<Column field="year" header="Year">
|
||||||
<template #editor="slotProps">
|
<template #editor="slotProps">
|
||||||
<InputText v-model="slotProps.data[slotProps.column.field]" />
|
<InputText v-model="slotProps.data[slotProps.column.field]" autofocus/>
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="brand" header="Brand">
|
<Column field="brand" header="Brand">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content-section implementation">
|
<div class="content-section implementation p-fluid">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5>Basic Cell Editing</h5>
|
<h5>Basic Cell Editing</h5>
|
||||||
<p>Simple editors with v-model.</p>
|
<p>Simple editors with v-model.</p>
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
|
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
|
||||||
<Column field="code" header="Code">
|
<Column field="code" header="Code">
|
||||||
<template #editor="slotProps">
|
<template #editor="slotProps">
|
||||||
<InputText v-model="slotProps.data[slotProps.column.field]" />
|
<InputText v-model="slotProps.data[slotProps.column.field]" autofocus />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="name" header="Name">
|
<Column field="name" header="Name">
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
|
@row-edit-init="onRowEditInit" @row-edit-cancel="onRowEditCancel">
|
||||||
<Column field="code" header="Code">
|
<Column field="code" header="Code">
|
||||||
<template #editor="slotProps">
|
<template #editor="slotProps">
|
||||||
<InputText v-model="slotProps.data[slotProps.column.field]" />
|
<InputText v-model="slotProps.data[slotProps.column.field]" autofocus />
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="name" header="Name">
|
<Column field="name" header="Name">
|
||||||
|
|
Loading…
Reference in New Issue