Skip to content

How to define default value for empty array select #543

Closed
@adaamz

Description

@adaamz

Hi,
how can I define default value if the value is empty array?

$qb.queryBuilder({
    operators: [{
        type: 'approve',
        nb_inputs: 1,
        apply_to: 'select',
        multiple: true
    }],
    filters: [{
        id: 'abc',
        label: 'Abc',
        input: 'select',
        operators: ['approve'],
        default_value: 'all',
        values: {all: 'All', 5: 'a', 10: 'b', 12: 'c'}
    }]
});

And json rules:

{
    "id": "abc",
    "operator": "approve",
    "value": []
}

It does not select the value "All" :-(

Is it possible somehow?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions