Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Jan 14, 2025
1 parent ac1337f commit 1c892a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion modules/backend/widgets/table/assets/js/build-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ Client.prototype.getRecords=function(offset,count,onSuccess){if(!count){onSucces
Client.prototype.createRecord=function(recordData,placement,relativeToKey,offset,count,onSuccess){if(placement==='bottom'){this.data.push(recordData)}else if(placement=='above'||placement=='below'){var recordIndex=this.getIndexOfKey(relativeToKey)
if(placement=='below')recordIndex++
this.data.splice(recordIndex,0,recordData)}this.getRecords(offset,count,onSuccess)}
Client.prototype.searchRecords=function(query,offset,count,onSuccess){const searchFields=this.tableObj.search.getSearchableColumns();console.log(this.data);console.log(query);console.log(searchFields);const matched=this.data.filter(function(record){for(let i=0;i<searchFields.length;i++){const value=record[searchFields[i]];if(value===undefined){continue;}if(value.toString().toLowerCase().includes(query.toLowerCase())){return true;}}return false;});if(matched.length===0){onSuccess([]);return;}if(!count){onSuccess(matched,matched.length);}else{onSuccess(matched.slice(offset,offset+count),matched.length);}}
Client.prototype.searchRecords=function(query,offset,count,onSuccess){const searchFields=this.tableObj.search.getSearchableColumns();const matched=this.data.filter(function(record){for(let i=0;i<searchFields.length;i++){const value=record[searchFields[i]];if(value===undefined){continue;}if(value.toString().toLowerCase().includes(query.toLowerCase())){return true;}}return false;});if(matched.length===0){onSuccess([]);return;}if(!count){onSuccess(matched,matched.length);}else{onSuccess(matched.slice(offset,offset+count),matched.length);}}
Client.prototype.updateRecord=function(key,recordData){var recordIndex=this.getIndexOfKey(key)
if(recordIndex!==-1){recordData[this.tableObj.options.keyColumn]=key
this.data[recordIndex]=recordData}else{throw new Error('Record with they key '+key+' is not found in the data set')}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@
Client.prototype.searchRecords = function(query, offset, count, onSuccess) {
const searchFields = this.tableObj.search.getSearchableColumns();

console.log(this.data);
console.log(query);
console.log(searchFields);

const matched = this.data.filter(function(record) {
for (let i = 0; i < searchFields.length; i++) {
const value = record[searchFields[i]];
Expand Down

0 comments on commit 1c892a7

Please sign in to comment.