We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8be7725 commit a47276aCopy full SHA for a47276a
src/store/TableDataStore.js
@@ -125,12 +125,12 @@ export class TableDataStore {
125
}
126
127
add(newObj) {
128
- if (newObj[this.keyField].trim() === "") {
+ if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') {
129
throw this.keyField + " can't be empty value.";
130
131
let currentDisplayData = this.getCurrentDisplayData();
132
currentDisplayData.forEach(function (row) {
133
- if (row[this.keyField].toString() === newObj[this.keyField]) {
+ if (row[this.keyField].toString() === newObj[this.keyField].toString()) {
134
throw this.keyField + " " + newObj[this.keyField] + " already exists";
135
136
}, this);
0 commit comments