Found a few bugs when loading via server side ajax
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia con le righe 751-758 di StateRestore.ts e con le righe 641-647 e 878 di StateRestoreCollection.ts. Riproduci lo scenario di aggiornamento usando gli esempi ajax collegati, verificando se gli stati caricati possono essere aggiornati e se viene eseguito il callback load in stile funzione. Il lavoro è completato quando gli stati caricati dal server conservano lo stato predefinito corretto e il comportamento di aggiornamento documentato funziona dopo l’aggiornamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 3
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataTables/StateRestore
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
DataTables/StateRestore#8 · 6 commenti ·
Tutte le issue di DataTables/StateRestore
Issue simili
-
bug user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
videojs/video.js#9400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rescript-lang/rescript#8765 ·
I maintainer di solito rispondono entro 1 giorno
-
feedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
githubnext/gh-aw-workshop#4417 ·
I maintainer di solito rispondono entro 1 giorno