MCPcopy Create free account
hub / github.com/AllenFang/react-bootstrap-table / edit

Method edit

src/store/TableDataStore.js:192–212  ·  view source on GitHub ↗
(newVal, rowIndex, fieldName)

Source from the content-addressed store, hash-verified

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() === '') {

Callers 1

BootstrapTable.jsFile · 0.80

Calls 3

getCurrentDisplayDataMethod · 0.95
filterMethod · 0.95
searchMethod · 0.95

Tested by

no test coverage detected