PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB23] - Changing  Zorder
[WB23] - Changing Zorder
Débuté par JP, 29 juin 2018 08:27 - 6 réponses
Posté le 29 juin 2018 - 08:27
Hi All

[WB23 Dynamic Site]

I have various template controls on a page. Is there a way to change the ZOrder of the controls, bring one above the others?

Thanks
Posté le 29 juin 2018 - 16:18
Hi JP

yes there is... I don't know with the new menus/ribbon, but in the old one, it's in the control menu

Best regards
Posté le 29 juin 2018 - 16:38
Fabrice,

Yes, I know it in design mode. Sorry, I meant changing it at run-time i.e. allow a user to change it?

Thanks
Posté le 29 juin 2018 - 17:44
Haaaa...

I did that a few years back, and I had to use some JS code (not very hard, if I remember correctly) for that... Be SURE that any field you use it on is set as DYNAMIC.

Best regards
Posté le 30 juin 2018 - 00:59
Hi JP,

I don't exactly know what you are trying to achieve, but what might be a solution is to use a cell with planes enabled (in the gui tab top right)
Put each template control on a plane and enable it using MyCell..Plane=n.
This is one of the best features of WB 22 and it works in server and browser code.

Kind regards,
Piet
Posté le 02 juillet 2018 - 10:31
Hi Piet and All

What i have is a page with several templates which contain some controls. The user can move these around the screen. Due to z-order, a control can be moved behind other controls (partially). So how to allow the user to choose to make a particular control foremost i.e. change the z-order to bring it to the front.


Piet, Thanks for the info on pages.
Posté le 02 juillet 2018 - 14:35
Hi JP,

Webdev does not have a z-order element in its styles.
Even in the editor it is poorly implemented, probably because it might mess up internal stuff in WB if they allow us to set a value.
Problem is that the template only exists in server code.
As Webdev is still using tables for the layout, you might end up trying to set a z-order for a <td> element, which is impossible.

What might work is placing each template in a cell and put a div around it using the html before and after on the advanced tab of the cell:
Before: <div id="element_1"> and after : </div>
Then use Javascript to change the style of the div to the desired z-order:
document.getElementById("element_1").style.zIndex = "1";
Be sure to set the cell to "can be overlaid".

Kind regards,
Piet