w2grid.js: Let render callback to optionally return 'title' property #2655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the renderer can return a lot of properties related to cell. But if you think about it, 'title' (to be shown as a tooltip by browser) is just another such property. So, offloading title generation to another
titlecallback doesn't have much sense, especially taking into account that rendered value and tooltip are oftentimes connected, so it's more efficient to generate them in one call, instead of making double work via two callback calls. Actually, it kind of possible to return title from renderer now, using divAttr property. But that kind of conflicts with existingrecordTitlessupport, so requires ugly workarounds if both are desired.So, this change gives well defined ordering, while retaining backward compatibility with existing
titlecallback:rendercallback returnstitleproperty, it has priority, and will be used regardless ofrecordTitlesstate. (Because if user defined custom render callback and returned title from it, then they want title to be rendered, period).