(newVal, rowIndex, fieldName)
| 190 | } |
| 191 | |
| 192 | edit(newVal, rowIndex, fieldName) { |
| 193 | const currentDisplayData = this.getCurrentDisplayData(); |
| 194 | let rowKeyCache; |
| 195 | if (!this.enablePagination) { |
| 196 | currentDisplayData[rowIndex][fieldName] = newVal; |
| 197 | rowKeyCache = currentDisplayData[rowIndex][this.keyField]; |
| 198 | } else { |
| 199 | currentDisplayData[this.pageObj.start + rowIndex][fieldName] = newVal; |
| 200 | rowKeyCache = currentDisplayData[this.pageObj.start + rowIndex][this.keyField]; |
| 201 | } |
| 202 | if (this.isOnFilter) { |
| 203 | this.data.forEach(function(row) { |
| 204 | if (row[this.keyField] === rowKeyCache) { |
| 205 | row[fieldName] = newVal; |
| 206 | } |
| 207 | }, this); |
| 208 | if (this.filterObj !== null) this.filter(this.filterObj); |
| 209 | if (this.searchText !== null) this.search(this.searchText); |
| 210 | } |
| 211 | return this; |
| 212 | } |
| 213 | |
| 214 | addAtBegin(newObj) { |
| 215 | if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') { |
no test coverage detected