Author Topic: An option to automatically set the cell title attribute  (Read 2249 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 147
    • View Profile
An option to automatically set the cell title attribute
« on: March 01, 2025, 12:13:19 am »
At the moment the only way to do it is in colModel.render:

Code: [Select]
render: function(ui){
return {
text: ui["cellData"], // This is not needed, included here for clarity
attr: 'title="'+ui["cellData"].replace('"',""")+'"'
}
}

When the column is narrow and the value is trimmed (if not multiline), the value is cut off, so hovering over to show the full value in the popup is nice for the user.

Also it would be nice to also be able to pass the attr as an object like:

attr: {
   "title": "Some message > this message & another bad char",
   "data-temp": "Some data variable"
}

EDIT: YOU CAN MAKE ATTR AN OBJECT.  I isn't mentioned in the API guide.

« Last Edit: March 01, 2025, 12:19:44 am by jplevene »