Child pages
  • Client Design Mode

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The client design mode will not persist the new positions/sizes of the elements, this is something that the developer has to take care of. By saving and restoring these elements for each user individually you can give the user his can have personal layouts. To save and restore positions/sizes it is important to give all the elements a name, so you can address them by they can be addressed in code using elements.elementName.

You can To enter client design mode using:

...

To exit client design mode you can use:

Code Block
	controller.setDesignMode(false)

If you want to To do something with the modifications of the user, you should specify handlers when you do to entering design mode, for example:

...

To be able to cancel the drag if the user sets the element somewhere you don't want itit should not go, the start positions should be saved here so they can be restored in the onDrop.

...

Every element that is selected will get this event, return true if the user should be able to select it, or false if the element should not be selectable in clientDesign mode. It is better practice to set elements not selectable with the client design properties before you go into entering clientDesign mode because then the element is elements are really not selectable. By using this method the user could see the element being selected for a fraction of a second.

...

Note
titlerecreateUI()

These are runtime properties and will be lost if you by use of controller.recreateUI().

There are two client design properties: selectable and handles.

...

By default an element with a name is selectable in client design mode but you an elements can be set elements to not be selectable.

Sample:

...


It is possible to set specific handles. For example only left and right if you want the user to should not be able to change the width of the element but not the height. This can be used to make a gantt where items can be made bigger for the time (width) but not for the height.

...