mistic100 / mistic100/jQuery-QueryBuilder

Default rules not being selected with bt-selectpicker enabled

Open
#974 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
544
PR merge metrics
No merged PRs in 30d

Description

We were experiencing a bug that prevented default rules from being applied when the bt-selectpicker plugin was enabled.

If anyone else has the same issue, we got round it by changing the render calls to refresh in the bt-selectpicker plugin definition. ie changed this...

    this.on('afterUpdateRuleFilter', function(e, rule) {
        rule.$el.find(Selectors.rule_filter).selectpicker('render');
    });

    this.on('afterUpdateRuleOperator', function(e, rule) {
        rule.$el.find(Selectors.rule_operator).selectpicker('render');
    });

...to this...

    this.on('afterUpdateRuleFilter', function(e, rule) {
        rule.$el.find(Selectors.rule_filter).selectpicker('refresh');
    });

    this.on('afterUpdateRuleOperator', function(e, rule) {
        rule.$el.find(Selectors.rule_operator).selectpicker('refresh');
    });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the bt-selectpicker plugin definition and its afterUpdateRuleFilter and afterUpdateRuleOperator handlers; the issue identifies these entry points and the relevant selectpicker calls. Reproduce the default-rules case with the plugin enabled, then verify that the default filter and operator selections are retained.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.