Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Found a few bugs when loading via server side ajax

オープン
#7 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend

調査の方向性

StateRestore.ts の 751-758 行、StateRestoreCollection.ts の 641-647 行および 878 行から始めます。リンク先の ajax の例を使って更新シナリオを再現し、読み込まれた状態を更新できるか、また関数形式の load callback が発火するかを確認します。サーバーから読み込まれた状態が正しい事前定義済みステータスを保持し、更新後に文書化された更新動作が機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Have been having issues trying to get StateRestore to load all states via server side Ajax call

using the function style ajax calls per See Here to control all the server side saving

I have never seen if (data.action === 'load') option ever fire... so I resorted to using the ajax stateRestore option on initial load
as See Here

Everything works until browser refresh and then you can't update any of the existing based on this area in StateRestore.ts (line 751-758)

//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;
}

what occurs is all the states are set to isPreDefined: true even for ajax loading

There is also a typo in StateRestoreCollection.ts where you in line 641-647

currState.stateRestore = {
isPredefined: false,
state: id,
tableId: this.s.dt.table().node().id
};

It s/b isPreDefined not isPredefined

I looked at your source code and I don't ever see a callback for the load process, and all the function Ajax examples don't ever load server side.

Your above initialisation/ajax.html example fails the same way

Steps:
1: Load a new state and try all the options (Rename, Update, Remove) they all fire a callback to server
2: Keep at least one state and re-fresh browser.
3: You can do all options except Update (check and all the loaded states are now IsPreDefined)

In my case, I never have preDefined: in the DataTable settings... so I turned off the true condition in StateResotrCollection.ts
_addPreDefined (line 878)

So in closing,
A) is there a way to load via function call Ajax from the server or
B) you should change the _addPreDefined call to add a boolean to set that isPreDefined to false for Ajax loads

Thanks

主要言語
JavaScript
スター
3
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataTables/StateRestore のほかの issue

DataTables/StateRestore の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。