- Load Events
- Edit Events - When a field is updated: undate also memory list record - Duplicate Event
This commit is contained in:
@@ -125,10 +125,10 @@ export default class CGridTableRec extends Vue {
|
||||
this.colVisib = []
|
||||
this.colExtra = []
|
||||
this.mycolumns.forEach((elem) => {
|
||||
if (elem.field !== '')
|
||||
if (elem.field !== tools.NOFIELD)
|
||||
this.colVisib.push(elem.field)
|
||||
|
||||
if (elem.visible && elem.field === '')
|
||||
if (elem.visible && elem.field === tools.NOFIELD)
|
||||
this.colExtra.push(elem.name)
|
||||
|
||||
})
|
||||
@@ -298,9 +298,9 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
// Save on Server
|
||||
GlobalStore.actions.saveFieldValue(mydata).then((esito) => {
|
||||
if (esito)
|
||||
if (esito) {
|
||||
tools.showPositiveNotif(this.$q, this.$t('db.recupdated'))
|
||||
else {
|
||||
} else {
|
||||
tools.showNegativeNotif(this.$q, this.$t('db.recfailed'))
|
||||
this.undoVal()
|
||||
}
|
||||
@@ -325,10 +325,13 @@ export default class CGridTableRec extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
public ActionAfterYes(action, item) {
|
||||
public ActionAfterYes(action, item, data) {
|
||||
if (action === lists.MenuAction.DELETE_RECTABLE) {
|
||||
if (this.serverData.length > 0)
|
||||
this.serverData.splice(this.serverData.indexOf(item), 1)
|
||||
} else if (action === lists.MenuAction.DUPLICATE_RECTABLE) {
|
||||
// Add record duplicated
|
||||
this.serverData.push(data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +348,7 @@ export default class CGridTableRec extends Vue {
|
||||
}
|
||||
|
||||
public visuValByType(col, val) {
|
||||
if (col.isdate) {
|
||||
if (col.fieldtype === 'date') {
|
||||
if (val === undefined) {
|
||||
return '[]'
|
||||
} else {
|
||||
@@ -369,7 +372,7 @@ export default class CGridTableRec extends Vue {
|
||||
let mytab = null
|
||||
if (this.tablesList) {
|
||||
if (!this.tablesel) {
|
||||
this.tablesel = this.tablesList[0].value
|
||||
this.tablesel = this.tablesList[1].value
|
||||
}
|
||||
|
||||
mytab = this.tablesList.find((rec) => rec.value === this.tablesel)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="q-pa-sm">
|
||||
|
||||
<q-table
|
||||
:data="serverData"
|
||||
:columns="mycolumns"
|
||||
@@ -83,8 +84,8 @@
|
||||
|
||||
<q-tr v-if="mytable" slot="body" slot-scope="props" :props="props">
|
||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field)">
|
||||
<div v-if="col.isdate">
|
||||
<div style="max-width: 250px">
|
||||
<div v-if="col.fieldtype === 'date'">
|
||||
<div style="max-width: 250px; min-width: 200px">
|
||||
<q-input dense v-model="props.row[col.name]">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer">
|
||||
@@ -117,6 +118,9 @@
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="col.fieldtype === 'boolean'">
|
||||
<q-checkbox v-model="props.row[col.name])" label="" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<div :class="getclassCol(col)">
|
||||
{{ visuValByType(col, props.row[col.name]) }}
|
||||
|
||||
Reference in New Issue
Block a user