Customize row index in decision tables in dmn-js (React.js)

Hello :slight_smile:

I would like into a decision table to display for every row, the rowId accompanied with the id from the rule as shown in the image below, instead of displaying only the index. Currently this id is only generated into the data-row-id in the DOM.

Screenshot 2021-09-01 at 19.01.09

I do understand that I need to write a custom function for the decisionRuleIndices module, but not quite sure how to do that other than copy-paste into my React project the code from the npm-package and change that line of the code. Plus, it doesnt seem that my code even compiles! Any ideas?

Thanks a lot in advance!

If it’s only about displaying the id, you can use this simple CSS trick:

.rule-index[data-element-id]::after {
    content: " (" attr(data-element-id) ")";
}

Outcome:

image

2 Likes

@barmac life saver trick! Thanks a lot!!! You saved me lots of time and effort :wink:

1 Like