cancel
Showing results for 
Search instead for 
Did you mean: 

set Caption at Tabs MDK

horiii
Explorer
0 Kudos
376

Hello,

I try to setCaption of Tabs Control but it's now working. I keep have this error:

TypeError: Cannot read properties of undefined (reading 'title')
I attached a rule to the item of Tabs Control and a rule to the caption of item.Have you any idea?Thanks

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert

To set the caption via a rule just return the string you want to display

export default function setCaptionRule(clientAPI) {
    // Do some stuff in the rule
    let myCaption = 'XYZ';
    let otherValue = '123';

    // Return the caption as a String
    return `${myCaption}-${otherValue}`;
}

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you help me understand what you are trying to do a little better?

Are you trying to use a rule for the ItemX / Caption property or a rule to return the whole Items array?\

For the caption, your rule just needs to return the String you want to display. If you can post your rule that could help as well.