Skip to main content
Nintex Community Menu Bar
Question

v2 Custom Field Render

  • July 11, 2024
  • 2 replies
  • 2 views

Forum|alt.badge.img+8

How can I use/access styles from the Design System?

I want to apply a style from Design System on a button I created with Custom Field Renderer.

Code:

const FieldRenderer = skuid.component.FieldRenderer;

return new FieldRenderer({

readModeStrategy: "virtual",

read: function (fieldComponent) {

    let h = fieldComponent.h,

        context = fieldComponent.cpi.getContext();

        let { element, field, model, row, value } = context;

    

    let childNodes = [];

    childNodes.push(

        h("button", {

            onclick(event){

                console.log('click1');

            }

        }, [

            `+`,

        ]));

    if(row.Added_By_User__c){

        childNodes.push(

        h("button", {

            onclick(event){

                console.log('click2');

            }

        }, [

            `-`,

        ]));

    }

    return h('div', {}, childNodes);

},

});

2 replies

Forum|alt.badge.img+3

Hi Lukas,

Were you able to determine how to apply the style with your custom renderer?


Forum|alt.badge.img+8

Hi Ben,

Thanks you for the reply.

Unfortunately, it’s not possible to apply DSS styles on Custom Components, hence will have to re-write the styling in the code.

Best