Is there any particular reason why the column.render and columnDef.renders do not support jQuery?

Is there any particular reason why the column.render and columnDef.renders do not support jQuery?

ekr3peeKekr3peeK Posts: 1Questions: 1Answers: 0

Is there any particalur reason why, when using the column.render or the columnDef.render methods, as a function, I need to return plain string?

As I have many different components that need to be initialized, and they use inner data attributes to perform correctly, if I want to insert a simmilar component to one of the table cells, I either need to add the data it needs as a html attribute to the element when using the above mentioned functions, or I need to use the rowCallback option, to post process these elements.

Wouldn't it be possible, for the column render and columnDef.render functions to return jQuery objects, from which the data is rendered?

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    Yes there is :).

    The rendering function needs to be able to return data for multiple data types - e.g. search, order and type detection as well as the display.

    You are absolutely right, if it was only used for the display component then it would be possible to return a jQuery object that contain a DOM node. My plan is to extend its ability so that when display data is requested then you can return a jQuery instance or a DOM node, but unfortunately that has not yet been implemented.

    columns.createdCell can be used to add attributes to a cell or its contents at the moment.

    Allan

This discussion has been closed.