Skip to main content
Nintex Community Menu Bar
Question

Custom component conditional rendering

  • Jul 10, 2024 1:35 PM UTC
  • 4 replies
  • 63 views
  • Translate All

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
  • Jul 10, 2024 2:48 PM UTC

Skuid?

Translate

Forum|alt.badge.img+11
  • Nintex Employee
  • Jul 10, 2024 2:48 PM UTC

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

Translate

Forum|alt.badge.img+18
  • Author
  • Jul 10, 2024 2:48 PM UTC

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; ]
Translate

Forum|alt.badge.img+4
  • Nintex Partner
  • Jul 10, 2024 2:48 PM UTC

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. 

Translate