KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

BSelect input control ignoring some template options when themeBase set #3417

Open Nathan Skelton opened this topic on on Feb 11, 2025 - 1 comments

Nathan Skelton commented on Feb 11, 2025

When the themeBase option is set, the li and resetButton template options are ignored. This is due to the loading order in BSelect.php:

            $this->options["templates"] = Utility::get($this->options,"templates",array());
            $this->options["templates"]["li"] = "<li><a tabindex='0' class='dropdown-item'><label></label></a></li>"; 
            if($this->getThemeBase() === "bs4") {
                $this->options['templates']['resetButton'] = '<div class="multiselect-reset text-center p-2"><button type="button" class="btn btn-sm btn-block btn-outline-secondary">Reset</button></div>';
            }

$this->options["templates"] = Utility::get($this->options,"templates",array()); should occur last rather than first.

How to reproduce:

BSelect::create(array(
    'name' => "mySelect",
    'multiple' => true,
    'data' => [
        "John Doe"=>"1",
        "Jane Doe"=>"2",
        "Whatever Doe"=>"3",
    ],
    'options' => [
        'includeSelectAllOption' => true,
        'templates' => [
            'button' => '<button type="button" class="multiselect dropdown-toggle" data-bs-toggle="dropdown"><span class="multiselect-selected-text"></span></button>',
            'filter' => '<div class="multiselect-filter d-flex align-items-center"><input type="search" class="multiselect-search form-control" /></div>',
            'li' => '<button type="button" class="multiselect-option dropdown-item"></button>',
        ]
    ],
    "themeBase" => "bs5",
));
Sebastian Morales commented on Mar 13, 2025

Thanks, Nathan, for your detail feedback. We will investigate this issue and fix it. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
bug

Inputs