Add header/title/etc for Searchbuilder Columndef

Add header/title/etc for Searchbuilder Columndef

pybcgpybcg Posts: 41Questions: 10Answers: 0

Description of problem: My datatable is composed of column headers that have multiple span elements. When I open the Searchbuilder, the column names show up with the column headers as its HTML (ie <span>header1</span><span>header2</span>). I looked into the Searchbuilder code and i noticed the option elements are built by using each column's "sTitle" attributes.

My request/question is would we be able to modify details about specific Searchbuilder columns like we do say Searchpanes? In Searchpanes, you can modify the header, show, className, emptymessage, etc. It'd be cool if we could do the same for Searchbuilder.

Replies

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    Seems like a good idea to me. I've raised it internally (DD-1947 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    I've created a new option columns.searchBuilderTitle that can be used to set custom titles for use in SearchBuilder. This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access it from the nightly builds.

    To set a custom title add something like this to your initialisation.

    columnDefs:[{
        searchBuilderTitle: 'Custom Title',
        targets: [1]
    }]
    

    That being said, the span tags shouldn't be shown in SearchBuilder. Take a look at this example that removes them. Would you mind seeing if you can reproduce the behaviour that you were seeing there in case there is a bug to fix?

    Thanks,
    Sandy

This discussion has been closed.