Set text on SearchPanes Button?

Set text on SearchPanes Button?

TrailBearTrailBear Posts: 4Questions: 2Answers: 0

I think I must be missing something. I am having trouble setting the text of a searchPanes button.
I have tried the following:
* Setting the "text" option in the button configuration
* Creating a config object with a text option.

Here's a fiddle, where I see "SearchPanes" as the title of both buttons.
* https://jsfiddle.net/FrankLoWa/9ky30w87/2/

Was hoping to see the text specified instead.

$(document).ready(function() {
  var table = $('#example').DataTable({
    dom: 'fBtip',
    buttons: [{
        extend: 'searchPanes',
        text: 'My Title'
      },
      {
        extend: 'searchPanes',
        config: {
          text: 'Other Title'
        }
      }
    ]
  });
});

Thanks in advance, and apologies if this is just me being blind.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925
    Answer ✓

    See if this example helps.

    Kevin

  • TrailBearTrailBear Posts: 4Questions: 2Answers: 0
    edited March 2022

    @kthorngren - yes, indeed! Thank you.
    I would never have thought to go to the language option.
    What I ended up with is a font-awesome filter icon

    language: {
        searchPanes: {
            collapse: {
                0: '<i class="fa fa-filter fa-lg"></i>',
                _: '<i class="fa fa-filter fa-lg"></i> (%d)'
            }
        }
    },
    
    

Sign In or Register to comment.