Have Column API only return specific rows
Have Column API only return specific rows
Hello,
I am populating a DataTable from a standard HTML table. I'm not allowing sorting for this particular table. My table consists of regular cells and also subtotal lines interspersed in the DT. The subtotal lines have a different color background (#CCCCCC).
Is there a way I can continue to populate the TataTable as I am now, but have the column/columns API calls return the requested data, excluding the subtotal lines based on their background color?
I'm assuming this will require modifying the API calls in the DT js file, just trying to figure out which method will require said modification... Any assistance is greatly appreciated!
Replies
What I would suggest is to use the
cells()
API with a combination of a row and column selector. For example:will get the nodes for the intersection of the cells in column 4 and rows which do not have a class of
.subtotal
on thetr
element (you might need to add that).The
cells()
method can often be used in place of therows()
orcolumns()
method in this fashion.Allan
Thanks for your help Allan!