Skip to content

Commit

Permalink
fb713097c83a6eb8ffe9c5291ca260bbd955d247 Example: No paging example s…
Browse files Browse the repository at this point in the history
…et the wrong parameter name

21bfe0369279ae8ab1b6a004565548b223e95e12 Fix: Set JSON data type for Ajax call

169b120d2ff1068804e727c6e89738deddfb620c Fix: Allow Ajax loaded states to be updated

Sync to source repo @169b120d2ff1068804e727c6e89738deddfb620c
  • Loading branch information
dtbuild committed Sep 30, 2024
1 parent 0d381c9 commit 3373341
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
],
"src-repo": "http://github.com/DataTables/StateRestore",
"last-tag": "1.4.1",
"last-sync": "58768145ec7d51fc22dd73be1b5426f1edc6ba53"
"last-sync": "169b120d2ff1068804e727c6e89738deddfb620c"
}
7 changes: 0 additions & 7 deletions js/StateRestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,6 @@ var StateRestore = /** @class */ (function () {
}
}
}
// If the state is predefined there is no need to save it over ajax or to local storage
if (this.s.isPreDefined) {
if (passedSuccessCallback) {
passedSuccessCallback.call(this);
}
return;
}
var ajaxData = {
action: 'save',
stateRestore: (_a = {},
Expand Down
2 changes: 2 additions & 0 deletions js/StateRestoreCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ var StateRestoreCollection = /** @class */ (function () {
ajaxFunction = function () {
$.ajax({
data: ajaxData,
dataType: 'json',
success: function (data) {
_this._addPreDefined(data);
},
Expand Down Expand Up @@ -689,6 +690,7 @@ var StateRestoreCollection = /** @class */ (function () {
});
// Append all of the toggles that are to be inserted
var checkboxesEl = this.dom.checkboxInputRow
.css('display', togglesToInsert.length ? 'block' : 'none')
.appendTo(this.dom.creationForm)
.find('div.dtsr-input')
.empty();
Expand Down
9 changes: 2 additions & 7 deletions js/dataTables.stateRestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,6 @@ var DataTable = $.fn.dataTable;
}
}
}
// If the state is predefined there is no need to save it over ajax or to local storage
if (this.s.isPreDefined) {
if (passedSuccessCallback) {
passedSuccessCallback.call(this);
}
return;
}
var ajaxData = {
action: 'save',
stateRestore: (_a = {},
Expand Down Expand Up @@ -1043,6 +1036,7 @@ var DataTable = $.fn.dataTable;
ajaxFunction = function () {
$$1.ajax({
data: ajaxData,
dataType: 'json',
success: function (data) {
_this._addPreDefined(data);
},
Expand Down Expand Up @@ -1552,6 +1546,7 @@ var DataTable = $.fn.dataTable;
});
// Append all of the toggles that are to be inserted
var checkboxesEl = this.dom.checkboxInputRow
.css('display', togglesToInsert.length ? 'block' : 'none')
.appendTo(this.dom.creationForm)
.find('div.dtsr-input')
.empty();
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.stateRestore.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/dataTables.stateRestore.min.mjs

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions js/dataTables.stateRestore.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,6 @@ let $ = jQuery;
}
}
}
// If the state is predefined there is no need to save it over ajax or to local storage
if (this.s.isPreDefined) {
if (passedSuccessCallback) {
passedSuccessCallback.call(this);
}
return;
}
var ajaxData = {
action: 'save',
stateRestore: (_a = {},
Expand Down Expand Up @@ -1003,6 +996,7 @@ let $ = jQuery;
ajaxFunction = function () {
$$1.ajax({
data: ajaxData,
dataType: 'json',
success: function (data) {
_this._addPreDefined(data);
},
Expand Down Expand Up @@ -1512,6 +1506,7 @@ let $ = jQuery;
});
// Append all of the toggles that are to be inserted
var checkboxesEl = this.dom.checkboxInputRow
.css('display', togglesToInsert.length ? 'block' : 'none')
.appendTo(this.dom.creationForm)
.find('div.dtsr-input')
.empty();
Expand Down

0 comments on commit 3373341

Please sign in to comment.