Reputation: 1
What is the proper way to us the "alwaysOnTop" property for components or windows?
If I define a window - say a toolbar - and set alwaysOnTop: true
, shouldn't that keep other windows from obscuring it?
Do windows with this property need to be registered with Ext.WindowManager?
Long story, I'm using the Desktop code (see here: https://examples.sencha.com/extjs/6....top/index.html). You will notice that you can move the windows over the bottom toolbar - this should not really happen.
Adding alwaysOnTop: true
to that taskbar code alone has no effect but doing subsequently doing this does:
Ext.WindowManager.register(taskbar)
Problem is that win.toFront()
no longer seems to work for other windows on the desktop. Such that if window A overlaps window B, B.toFront()
will have no effect.
So, the question is, what is the proper way to use alwaysOnTop for specific items yet have other windows behave as expected?
Upvotes: 0
Views: 672
Reputation: 1
Ok, so you still need to register the windows you want 'alwaysOnTop' but it turns out the reason why the window will not come to the front is that the ZIndexManager will not promote a window up if there is any window that has been register as "alwaysOnTop".
The function bringToTop() contains the following code:
if (!comp || zIndexStack.find('alwaysOnTop', true)){
return false;
}
This will keep the window in question from moving up in the stack. removing the alwaysOnTop comparison seems to solved my issue. When setActiveCounter is executed on your component, that will trigger a call to resort the collection and place windows on that have 'alwaysOnTop" set on the top of the stack, followed by the one in question.
The result of this is that the task bar at the bottom of the desktop will always stay on top, and your floating windows promotion/demotion will behave as they should.
Upvotes: 0
Reputation: 58
Have you checked below link? I think we have to apply other methods like this for achieving the output. Always on top
Upvotes: 0