Custom values in Search Panes

Custom values in Search Panes

globalplaneglobalplane Posts: 70Questions: 12Answers: 0

For my table, I would like the value shown in the Search Panes box to be different from the value shown in the table for each row. For example, the rows might show b, b, a, b, a, a, b and the Search Panes would show the options Beginner for b and Advanced for a. Could someone tell me how this is done?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,795Questions: 1Answers: 10,115 Site admin
    Answer ✓

    I think this example is what you are looking for.

    Allan

  • globalplaneglobalplane Posts: 70Questions: 12Answers: 0

    Thanks, I think that'll work!

  • globalplaneglobalplane Posts: 70Questions: 12Answers: 0
    edited April 2023

    Hmm, so the actual data in the cells I'm working with is a bunch of HTML, and what I want in SearchPanes is a simple string. While I think it can be done with this method, by setting value to the full HTML and label to the string, this seems messy. Is there a way to set value to something like a data attribute on the <tr>? Like this:

    <tr data-value="b"><td>[bunch of messy html]</td></tr>
    

    Or actually just setting a data-label on the <tr> with exactly what I want to show up in the SearchPanes for that column would be easier if that could be done.

  • allanallan Posts: 61,795Questions: 1Answers: 10,115 Site admin

    No sorry. It should be possible with data-search attribute on the td, but not on the tr.

    Allan

  • globalplaneglobalplane Posts: 70Questions: 12Answers: 0

    I'm using AJAX, though. Could data-search be used in that case?

  • allanallan Posts: 61,795Questions: 1Answers: 10,115 Site admin

    No, however, you can use orthogonal data in a different way with SearchPanes, through the columns.searchPanes.orthogonal option.

    Allan

Sign In or Register to comment.