@@ -214,7 +215,9 @@
- [data-col="{{ resizingCol }}"]{min-width:{{ resizingColWidth }};max-width:{{ resizingColWidth }};width:{{ resizingColWidth }};}
+ [data-col="{{ resizingCol }}"]{min-width:{{ resizingColWidth }};max-width:{{
+ resizingColWidth
+ }};width:{{ resizingColWidth }};}
@@ -261,7 +264,8 @@ export default {
table: String,
isVirtual: Boolean,
isLocked: Boolean,
- columnsWidth: { type: Object }
+ columnsWidth: { type: Object },
+ isPkAvail: Boolean
},
data: () => ({
resizingCol: null,
@@ -426,6 +430,10 @@ export default {
return
}
if (e.key && e.key.length === 1) {
+ if (!this.isPkAvail && !this.data[this.selected.row].rowMeta.new) {
+ return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000)
+ }
+
this.$set(this.data[this.selected.row].row, this.availableColumns[this.selected.col]._cn, '')
this.editEnabled = { ...this.selected }
}
@@ -466,10 +474,14 @@ export default {
this.editEnabled = {}
}
},
- makeEditable(col, row) {
+ makeEditable(col, row, _, rowMeta) {
if (this.isPublicView || !this.isEditable) {
return
}
+
+ if (!this.isPkAvail && !rowMeta.new) {
+ return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000)
+ }
if (this.availableColumns[col].ai) {
return this.$toast.info('Auto Increment field is not editable').goAway(3000)
}
|