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