Skip to main content
Nintex Community Menu Bar
Question

Custom component conditional rendering

  • July 10, 2024
  • 4 replies
  • 31 views

Forum|alt.badge.img+18

Anyone successfully added a ‘rendering conditions’ tab to their custom components?

Can I steal your code from you?

This topic has been closed for replies.

4 replies

Forum|alt.badge.img+18
  • Author
  • July 10, 2024

Skuid?


Forum|alt.badge.img+11

Matt~

Please see Ben’s response to your other post: https://community.skuid.com/t/custom-component-action-framework. We will let you know as soon as the documentation is available. In the meantime, anyone else try this before that can help Matt out? 

Thanks for your patience!
Karen


Forum|alt.badge.img+18
  • Author
  • July 10, 2024

Hi Friends,

You can add the Rendering tab to your custom component like so:

var propCategories = [<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "Basic",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; props: basicPropsList,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: "Advanced",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; props: advancedPropsList<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>c.getRenderingCategory({<br></b><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; component: component,<br></b><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; model: null,<br></b><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; propViewer: propertiesObj<br></b><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br></b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ];


Where the bold code is relevant for conditional rendering, and c = b.core and b = skuid.builder;

As a bonus, the advancedPropsList is just the unique id and css class property fields, and can be generated like so:

var advancedPropsList = [<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.coreProps.uniqueIdProp({component: component}),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b.cssClassProp<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]

Forum|alt.badge.img+4

Hey Matt,

Just wanted to say thank you for posting this. I was able to add the rendering tab easily to a custom component I’m working on.