Page 5 of 5

Re: Community widgets

Posted: Wed Apr 29, 2020 2:37 pm
by FourthWorld
The DataGrid is a good example of a custom control.

To make your own, put the objects it needs into a group, and set the group's selectGroupedControls property to false. Copy where needed. That's pretty much it.

To simplify maintenance you may want to put most of the group's code into a separate script, and have each instance use that script as its Behavior.

If you plan on using the custom control in multiple projects you may want to store that behavior script in a separate stack file. If you'll be using it in just one app the behavior script can be a substack in your main stack file, or even a button within that stack file.

Experiment with this and report back where we can help with any details.

Re: Community widgets

Posted: Tue May 05, 2020 1:40 pm
by giovanni_c
Hi Richard, thanks for feedback.
I will try what you suggest and will let you know.

Re: Community widgets

Posted: Tue May 05, 2020 3:08 pm
by FourthWorld
A tip I forgot to include in my last post:

If you have the group adjust the positions of any controls inside it, you may find things much simpler if you see the lockLoc of the group to true.

By default groups will resize themselves to fit their contents, but with the lockLoc on you'll find they stay where you want them while your script adjusts things inside them.