Skip to main content
Question

How to retrieve component's properties in order reflecting the UI setting?

  • October 17, 2022
  • 1 reply
  • 398 views

Ryba

componentPropertyDefinitions is a “new” way to return defined properties of the ComponentNode or ComponentSetNode.

Unfortunately, the object it returns has keys (= property names) sorted in unknown order, rather than reflecting order set in the UI.

Deprecated variantGroupProperties seems to keep the order of variants sorted as in the UI. It really helps e.g. in organizing variants accoring to intended order.

Is there any way to retrieve component’s properties in the order, that was set up in the UI?

Additional reference: Version 1, Update 49

1 reply

Ryba
  • Author
  • 9 replies
  • October 18, 2022

I realized that variantGroupProperties is not predictable as well – in terms of retrieving variant order.

However, I found an ugly trick. I can get variants in proper order when I use componentProperties on an InstanceNode. This way I can “silently” create any instance from component set and read ordered properties from it.

I don’t like it, so maybe someone would find better solution to this.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings