-
24 May 2012 12:45 AM #1
Window hide method sets position to -10000
Window hide method sets position to -10000
I can't really make a test case for this issue so I'll try to explain it the best way I can.
Here is the context of my problem:
In our application we have filter windows that allow users to filter grid data based on some parameters. The state of these windows are kept in our database to keep the same grid data between two visits of the page. So, whenever the 'ok' button of the window is clicked, we trigger the saving of the state and we hide the window to load the grid data. We have a delay of 2 seconds to avoid having too many requests sent to the server. The HttpProvider is defined that way:
Now that you have the context, here is the problem:Code:Telefleet.initStateProvider = function(config) { Ext.state.Manager.setProvider(new Ext.ux.state.HttpProvider({ url: serverUrl, delay: 2000, autoRead: false, logFailure: true, logSuccess: false} )); Ext.state.Manager.getProvider().initState(config.initState); };
In 4.0.7, the getState method of Ext.window.Window saved the correct position of the window even though it was already hidden (because of the 2 seconds delay).
In 4.1.1, the same method saves a position of {x: -10000, y: -10000}, because it takes the position of the hidden window. So, when the state restores, it immediately hides it...
Is this new behavior a bug or is it done on purpose ?
If so, please give me some advise to still save the "good" position of the window (I mean before it's hidden).
PS: Please tell me if I haven't made myself clear enough.
-
31 May 2012 1:33 AM #2
It feels like no one has the slightest clue what I'm talking about..
-
31 May 2012 3:08 AM #3
Don't worry, I'm sure that Sencha developers know exactly what you are talking about, they just ignore you.
Anyway, you can try changing window hideMode config option to 'visibility' or 'display'.
-
1 Jun 2012 7:10 AM #4
Setting the mode to 'visibility' will display preserve the correct values.
Scott.Code:Ext.onReady(function(){ var win = Ext.create('Ext.window.Window', { title: 'Hello', height: 200, width: 400, layout: 'fit', hideMode: 'visibility', items: { xtype: 'grid', border: false, columns: [{header: 'World'}], store: Ext.create('Ext.data.ArrayStore', {}) } }).show(); win.hide(); console.log(win.x+','+win.y); console.log(win.getState()); });
-
1 Jun 2012 7:34 AM #5
-
1 Jun 2012 6:20 PM #6
I've had similar problems restoring a complex application with several windows from a state. In 4.0.7 the z-order is remembered correctly, but in 4.1 it gets lost, and in fact the top most window is always the last to update/redraw.


Reply With Quote