Search Pane row grouping

Search Pane row grouping

mattprammattpram Posts: 6Questions: 3Answers: 0

I have a table which has form inputs in the columns for a date. I am trying to have the searchPane filter by the value of that input field. I have a custom render function which pulls the value of that input field and that works great. However I am getting duplicate rows in the search pane. Does anyone have any insight on how to overcome this?

If you look at https://s3.amazonaws.com/pramadillo/InteleWorx_-_Rent_Case_Manager_2020-10-01_09-54-54.png this is an example of my search pane.

This is the render code I am using

{
                searchPanes:{
                    show: true,
                    dtOpts: {
                        "columnDefs": [{
                            "targets": 0,
                            "render": function(data, type, row, meta) {
                                var position = (data.search('value="') + 7);
                                var date = data.substring(position, (position + 10));

                                return '<span class="dtsp-name">' + date + '</span><span class="pill badge badge-pill badge-secondary">' + row.total + '</span>';
                            }
                        }]
                    }
                },

                targets: [23],

            },

Answers

  • mattprammattpram Posts: 6Questions: 3Answers: 0

    Also, I have tried using the data-search attribute and simply input the raw date in there, that however did not have any affect on the search pane.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @mattpram,

    I'd guess that your renderer is returning different values for each of those cells? Can you check what it is returning each time please.

    In order to help any more can you please provide a test case. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • mattprammattpram Posts: 6Questions: 3Answers: 0

    hey @sandy yes those cells all do have different values, so I know why it is doing it, I was just wondering if there was a way around that. In the meantime, I simply just added a new column with the raw date, and then hid that column from my table using css

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @mattpram ,

    If the values are different then SearchPanes will give them all their own option. Your solution works. Another option would be to add custom options using columns.searchPanes.options

    Thanks,
    Sandy

This discussion has been closed.