Why is rowId a DOM element id instead of a data attribute?

Why is rowId a DOM element id instead of a data attribute?

creativetagscreativetags Posts: 2Questions: 1Answers: 0

Why <tr id="1" role="row"> and not <tr data-id="1" role="row">

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    To allow easy row selection with id values. You could use createdRow to assign a data property if you prefer.

    Allan

  • creativetagscreativetags Posts: 2Questions: 1Answers: 0

    Chances are you want a numeric id which isn't valid HTML for the id attribute. Set it as a data attribute and that's not a problem.

This discussion has been closed.