[IGN-6743] system.perspective.alterDock can only resize one dock at a time?

I recently started doing some testing to resize docks using the new system.perspective.alterDock function, and it seems that it can only be applied to one dock at a time when I tested it on 8.1.21. Is this expected behavior, or is there some way to get the size change to stick?

The environment I'm testing in has left, top, and right docks, and I'd like to be able to specify sizes for all 3 at the same time depending on the situation.

alterDock takes a dockID as a required parameter. Are your docks the same ID and only 1 is being affected? If this is your case, I would create 3 unique dockIDs and call the function 3 times.

ex.

dockConfig = {}
system.perspective.alterDock(leftDock, dockConfig)
system.perspective.alterDock(rightDock, dockConfig)
system.perspective.alterDock(topDock, dockConfig)

Each dock has it's own unique ID. Here's an example of the script I'm trying to run:

def runAction(self, event):
	system.perspective.alterDock('topMenu', {'size':100})
	system.perspective.alterDock('leftMenu', {'size':640})
	system.perspective.alterDock('settings', {'size':500})

When the button with this script assigned is pressed you can barely catch a glimpse of the first two docks resizing before returning to their original size and only the last dock called retains the change.

This is also happening in 8.1.20. Only 1 dock changes. ( the last alterDock line is the one that works as expected)

Before I even begin trying to replicate this, I need more information about the layout within the session.

Are all of these docks on the same side? Two on the left and one on the top? Is any dock open/expanded when this is invoked? Which dock is expanded? What are the dimensions of the docks before you attempt to modify them? All of these docks are all attached to the current page, correct? Did you leave the page and then navigate back to it?

The docks are on different sides, each dock is configured on Shared settings so they are attached to all pages, and leaving the page causes the one dock that had the size increased return to its previous size. Here are the original specifics of each dock:

Dock ID: leftMenu
Dock Location: left side
Display: auto
Resizable?: false
Content: push
Size: 320
Auto Breakpoint 1,600
Handle: hide

Dock ID: topMenu
Dock Location: top side
Display: visible
Resizable?: false
Content: push
Size: 50
Handle: hide

Dock ID: settings
Dock Location: right side
Display: onDemand
Resizable?: false
Modal?: false
Content: cover
Size: 250
Handle: hide

I've opened a ticket to get this resolved.

Ignition 8.1.21
I have the same issue with alter dock when I try to alter viewParams of multiple docks

Is there any progress on this ticket ?

No, not at this time.

I Hope this could be fixed soon. Most of our application need to alter multiple docks.
As a workaround we have to copy some dock settings for lots of view, but it's not very smart, readable and simple to maintain.

1 Like

Any move forward for this ticket. Any chance it will be in 8.1 version ?

1 Like

No movement and no target version.

Hi @cmallonee,

Since alterDock can only target one side of the page, what was the original intention of having this function? Was it to alter everything? Just one dock/side?

During my tests today, in version 8.1.33, it is possible to change all docks from one side of the page. If I change two sides, left and right in my case, only the last one remains.

Of course the goal is to alter any docked View, for any side of the page. The referenced bug was opened due to exactly the behavior you're seeing: any Docked View can be altered, but once you alter a second Docked View the changes to the first are reverted.

When using mobile versions docked views are in the way. If one holde the phone vertically, those docked views take up space. Sometimes there is only one dock but in some pages there are many. If any of docked views are opened then it will cover the entire screen.
Is there a way to solve that?

We have a separate, unrelated ticket to allow for better configuration of Docked View breakpoints. In early Perspective development, the decision was made that the breakpoint property of Docked Views should mean "if the viewport is wider than X, display this Docked View". But that logic severely restricts how Docked Views can be used. The logged feature would allow for

  1. Specifying a breakpoint value.
  2. Specifying whether that value should be used as a lesser-than or greater-than value.
  3. Specifying whether the Docked View should expand or collapse based on your condition.

The implementation of such a feature has not been fully described, so these settings may just get wrapped into an expression field in the end.

All of that to say: sorry, but there's no good solution to "altering" Docked Views on mobile. The "best" solution is to use a change script on the relevant page props and just close all Docked Views for mobile users in certain scenarios.

Is this a ticket that should be in canny?

I don't think it will hurt, as there's no way to track customer interest aside from the forums and the Ideas portal.

Link to canny:

https://inductiveautomation.canny.io/ignition-features-and-ideas/p/ign-6743-systemperspectivealterdock