Searching the contents of a RowGroup header

Searching the contents of a RowGroup header

htwyfordhtwyford Posts: 23Questions: 9Answers: 1
edited August 2017 in Free community support

To simulate groups in Excel, I am using RowGroup to show a number of values that are common to the child rows, and then blanking out those values in the child rows. I've attached a screenshot to demonstrate what I mean.

The blanking out is just done by setting columns.render to return '' like so:

{
    data: "job_number",
    render: function (data, type, row, meta) {
        return '';
    }
}

I like the look of this approach, but I have encountered one problem: the search bar is rendered almost useless. It can't search the information in the RowGroups, only the budget values in the child rows. Is there a way to configure search to search through the RowGroup header? Or, better yet, a way in the API to "blank out" the hidden values in the child rows while they remain searchable. I suppose I could set the text to color: white in the child rows, but I'd like to investigate solutions that remove those values from the DOM first.

I've searched the API docs and examples for DataTables and RowGroup, and didn't find anything useful, although I may have missed it. I have an Editor license, if using Editor will somehow make this easier.

Thanks!

EDIT: I also can't order by the 'blank' columns! Any advice is appreciated.

Answers

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin

    You could use orthogonal data to do what you are looking for:

    {
        data: "job_number",
        render: function (data, type, row, meta) {
            return type === 'display' ?
                  '' :
                  data;
        }
    }
    

    Allan

This discussion has been closed.