Skip to content

Commit

Permalink
prevent regeneration of autocolumn on filter and sort change in remot…
Browse files Browse the repository at this point in the history
…e mode
  • Loading branch information
olifolkerd committed May 2, 2022
1 parent be6bf99 commit a4c1214
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions dist/js/tabulator_esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class CoreFeature{
/////////////// DataLoad /////////////////
//////////////////////////////////////////

reloadData(data, silent){
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent);
reloadData(data, silent, columnsChanged){
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);
}

//////////////////////////////////////////
Expand Down Expand Up @@ -8951,7 +8951,7 @@ class Filter extends Module{
refreshFilter(){
if(this.tableInitialized){
if(this.table.options.filterMode === "remote"){
this.reloadData();
this.reloadData(null, false, false);
}else {
this.refreshData(true);
}
Expand Down Expand Up @@ -18312,7 +18312,7 @@ class Sort extends Module{

refreshSort(){
if(this.table.options.sortMode === "remote"){
this.reloadData();
this.reloadData(null, false, false);
}else {
this.refreshData(true);
}
Expand Down Expand Up @@ -22863,7 +22863,7 @@ class DataLoader extends CoreFeature{

initialize(){}

load(data, params, config, replace, silent){
load(data, params, config, replace, silent, columnsChanged){
var requestNo = ++this.requestOrder;

this.dispatchExternal("dataLoading", data);
Expand Down Expand Up @@ -22899,7 +22899,7 @@ class DataLoader extends CoreFeature{

if(rowData !== false){
this.dispatchExternal("dataLoaded", rowData);
this.table.rowManager.setData(rowData, replace, !replace);
this.table.rowManager.setData(rowData, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
}
}else {
console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made");
Expand All @@ -22926,7 +22926,7 @@ class DataLoader extends CoreFeature{
data = [];
}

this.table.rowManager.setData(data, replace, !replace);
this.table.rowManager.setData(data, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
return Promise.resolve();
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/tabulator_esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/modules/Filter/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class Filter extends Module{
refreshFilter(){
if(this.tableInitialized){
if(this.table.options.filterMode === "remote"){
this.reloadData();
this.reloadData(null, false, false);
}else{
this.refreshData(true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/Sort/Sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class Sort extends Module{

refreshSort(){
if(this.table.options.sortMode === "remote"){
this.reloadData();
this.reloadData(null, false, false);
}else{
this.refreshData(true);
}
Expand Down

0 comments on commit a4c1214

Please sign in to comment.