Feature conflict - ellipsize / invalidate
Feature conflict - ellipsize / invalidate
I have fairly complex table where every cell is editable. Some cells are dependant on others, ie a single cell edit may affect multiple cells within a row. Edit is done with jeditable, and jquery is used to update to the dom. After this I use row.invalidate()
to update DataTables internals with the changes.
One of the table columns is a textarea, so there is an ellipsize function (similar to the plugin offered here) to present a shortened string when not editing. This is called in render
(type display). As the string is editable, this returns an HTML snippet (anchor etc) - so it is modifying the dom.
The issue I'm hitting is that row.invalidate()
is reading the ellipsized string in the dom and storing it internally, ie the full-text version of the string is overwritten. A subsequent edit renders the ellipsized string in the edit form.
What is the correct way to handle this?
Answers
Small correction (too late to edit original post): actual invalidate call is
row.invalidate( 'dom' )
.I would suggest looking at Editor - as that's been designed to make the editing of DataTables easy. The updates there happen without a need to invalidate the data.
Colin
Solved by by replacing the ellipsis function with css:
text-overflow: ellipsis;