mistic100 / mistic100/jQuery-QueryBuilder

Invert plugin and custom operators (`operatorOpposites ` and `conditionOpposites` update defaults)

Open
#972 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

I see here in the doc https://querybuilder.js.org/plugins.html#invert that i need to update operatorOpposites and conditionOpposites in order to my customs operators

The plugin uses the operatorOpposites and conditionOpposites builder options to map each condition/operator to its invert. You must update it if you add new operators and conditions.

Right, but how do i update these ? I tried something like

  $('#builder-basic').queryBuilder.defaults({
    operatorOpposites: {
       'equal': 'not_equal',
  }}
  )

but it have no effects. Am i supposed to directly modify the plugin source code ??

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

Start with the plugins.html#invert documentation and the queryBuilder.defaults entry point mentioned in the report. Check how custom operatorOpposites and conditionOpposites mappings are configured, then document a working example and clarify whether plugin source changes are required.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.