SearchPane - column selection

SearchPane - column selection

FreedyFreedy Posts: 3Questions: 1Answers: 0

Hi,

I have a quick question, when using the SearchPane how would I use just the 2nd and 3rd columns for
filtering?

Thanks,
Thomas

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 1,668Questions: 18Answers: 352

    Depending on what you want you can start with one of these two examples:

    https://datatables.net/examples/api/multi_filter.html

    https://datatables.net/examples/api/regex.html

    Kevin

  • tangerinetangerine Posts: 1,922Questions: 9Answers: 213
    edited December 5

    It's explained in the SearchPane documentation. Use the "columns" option: " The columns that should have search panes shown."

  • allanallan Posts: 43,525Questions: 1Answers: 5,695 Site admin

    Yup - options are documented in the blog post include the columns option @tangerine mentioned.

    Allan

  • FreedyFreedy Posts: 3Questions: 1Answers: 0

    Hi,
    Would the syntax be something like this?

    searchPane: {
        columns: [
                {'name' : 'JobID'},
                {'name' : 'Customer'}
            ],
    
        threshold: 0
    },
    

    Thanks,
    Thomas

  • allanallan Posts: 43,525Questions: 1Answers: 5,695 Site admin
    Answer ✓

    No it would be:

    searchPane: {
      columns: [ 'JobID:name', 'Customer:name' ],
      threshold: 0
    }
    

    This assumes you've set the column names using columns.name.

    See the column-selector documentation for details of what you can use as column selectors.

    Allan

  • FreedyFreedy Posts: 3Questions: 1Answers: 0

    Thank you,
    I was missing the columns.name Option. Will there be support for serverSide
    in the future?

    Thanks,
    Thomas

  • allanallan Posts: 43,525Questions: 1Answers: 5,695 Site admin

    Possibly. At the moment the data to show is determined by the data in the table. With server-side processing, the server would need to pass a list of options to the client-side. That is certainly something that can be looked into.

    I've added it to the list here.

    Allan

Sign In or Register to comment.