"Filters Active - 0" with searchPanes - why are searchPanes not shown? (No Search Panes)

"Filters Active - 0" with searchPanes - why are searchPanes not shown? (No Search Panes)

kmitovkmitov Posts: 6Questions: 1Answers: 0
edited September 2020 in Free community support

I tried to introduce filtering to a table using searchPanes. I could not get it working so though I would share if others are stumbling and return feedback.

I am still not sure if filtering happens on the server or on the client. It says that it supports server side but in the same time there is a threshold that I understand as a client side. I just want to filter between "groups that are open for enrollment and groups that are closed". It is a simple boolean property to filter and it's been a day already.

The threshold option was a big surprise. I am not sure how useful it is but at least there is an option to force the column to be shown.

Here is the path I have taken:


  1. Configuration is
      dom: "Pfrtip",
      searchPanes: true,

I open the there is a text "No Search Panes", a "Clear All" button and "Filter Active-0". No errors in the console.

I have tried https://datatables.net/forums/discussion/60109/no-searchpanes
which suggests calling

table.searchPanes.rebuildPane();

It did not help. Still "No Search Panes"

  1. I have tried
searchPanes: {
        threshold: 1
      },

as suggested at : https://datatables.net/blog/2020-01-13#Features
Still "No search Panes'

  1. I have tried
      dom: "Pfrtip",
      searchPanes: true,
      columnDefs:[
          {
              searchPanes:{
                  show: true,
              },
              targets: [0],
          },
          {
              searchPanes:{
                  show: true,
              },
              targets: [4],
          }
      ],
           dom: 'Pfrtip',

but then I ended up opening https://github.com/DataTables/SearchPanes/issues/17 as the search panes are without style and can not be used.

Replies

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923

    It says that it supports server side but in the same time there is a threshold that I understand as a client side.

    Are you using server side processing? If yes have you read the SearchPanes serverside procesing docs and this Blog post about SearchPanes with serverside processing?

    Sounds like you have a few issues to work through. Can you post a link to your page so we can help? If not then a test case would be a good place to start. Here is a basic SearchPane test case you can start with. Please update it with an example of your data so we can understand exactly what you have.
    http://live.datatables.net/tomogule/1/edit

    Kevin

  • sandysandy Posts: 913Questions: 0Answers: 236
    edited September 2020

    Hi @kmitov ,

    Kevin has definitely pointed you in the right direction, I just thought I would expand on some of what you have said above.

    If you are using ServerSide processing then reading the docs and the blog post that Kevin has linked to is where to start. The panes that will be displayed when you are using ServerSide processing is purely down to the data that is returned from the server. Options like searchPanes.threshold and columns.searchPanes.show will not have any effect here.

    If you are using SearchPanes with client side processing these options start to become useful. The searchPanes.threshold option basically defines the point at which SearchPanes will automatically display a pane, this is details more in the docs. The columns.searchPanes.show option forces SearchPanes to show for that column, if you are wanting to force a specific pane to show, I would use this over the searchPanes.threshold option.

    Thanks,
    Sandy

This discussion has been closed.