Bugfix:
Code:...
for (var ii=0; ii<this.queue.length; ii++) {
if (this.queue[ii][this.paramNames.name] == o[this.paramNames.name]) {
this.queue[ii] = o;
found = true;
}
}
...
Printable View
Yes, thank you for debugging. Grab the new code from the first post.
:) :) :)
Another change, in onReadSuccess:
Bugfix
orig:
patch:Code:if(!(data instanceof Array) && true === this.logFailure) {
this.log(this.dataErrorText, data, response);
return;
}
and in queueChange:Code:if (data == null || !(data instanceof Array)) {
if (true === this.logFailure) {
this.log(this.dataErrorText, data, response);
}
return;
}
orig:
my version:Code:var changed = undefined === this.state[name] || this.state[name] !== value;
Code:var changed = undefined === this.queue[name] || this.queue[name] !== value;
What do you think about?
The test you propose is redundant as if data === null (btw, always use three = when testing for null) data is not instance of array.
No, you have to test if state changed, not queue. Queue is very fragile thing, it's cleared always on successful server save. Purpose of this test is not to save state item that hasn't changed.Quote:
and in queueChange:
orig:
my version:Code:var changed = undefined === this.state[name] || this.state[name] !== value;
What do you think about?Code:var changed = undefined === this.queue[name] || this.queue[name] !== value;
I have some problems, sometimes I lose any values.
scenario:
[desktop example]
- drag and drop windows
- save to server with HttpProvider saveSubmit
- page refresh
- windows are in correct position
- I don't change anything
- save to server with HttpProvider saveSubmit
- page refresh
- error: I lose the windows position information
It perhaps misses the passage from state to queue.
The queue is empty and override the state value.
What do you think?
Do you explicitly call submitState()? If yes you shouldn't.
I'm using the same code as is in the first post and I never lost any state of anything whatsoever. Doesn't it get lost serverside?
Well, if you found the problem: "state lost serverside", and the above mentioned call does work, in that case I do not see any problem. Just set timeout high enough and call submitState on exit...
Thank you Jozef,
I have another problem:
when the event 'onunload' fires I call this:
Ext.state.Manager.getProvider().submitState();
It's work fine, but with IExplorer I have this error (example):
The instruction at "0x0000000000000" referenced memory at "0x0000000000000". The memory could not be "read".
Unfortunately, I have no idea. First, I do not use Micro$oft products and second, I've never used HttpProvider in this setup. BTW, onbeforeunload event is one of the most painful spots if you want a cross-browser application. I was replying to one thread recently where one user wanted to implement it and failed. You can try to search forums for onbeforeunload keyword.