Skip to content

Issues with latest release 2.4.3 #487

Closed
@kambojankit

Description

@kambojankit

I am working with the library for the first time, configuring it doesn't seem to be working. I have setup the the library to work with angular, and configuration are as below:

but getting below error:

$('#builder').queryBuilder({
            filters: [
                {
                    id: 'name',
                    label: 'Name',
                    type: 'string'
                }, 
                {
                    id: 'in_stock',
                    label: 'In stock',
                    type: 'integer',
                    input: 'radio',
                    values: {
                        1: 'Yes',
                        0: 'No'
                    },
                    operators: ['equal']
                }, 
                {
                    id: 'price',
                    label: 'Price',
                    type: 'double',
                    validation: {
                        min: 0,
                        step: 0.01
                    }
                }, 
                {
                    id: 'id',
                    label: 'Identifier',
                    type: 'string',
                    placeholder: '____-____-____',
                    operators: ['equal', 'not_equal'],
                    validation: {
                        format: /^.{4}-.{4}-.{4}$/
                    }
                }
            ],

            rules: {
                condition: 'AND',
                rules: [
                    {
                        id: 'price',
                        operator: 'less',
                        value: 10.25
                    }, 
                    {
                        condition: 'OR',
                        rules: [
                            {
                                id: 'category',
                                operator: 'equal',
                                value: 2
                            }, 
                            {
                                id: 'category',
                                operator: 'equal',
                                value: 1
                            }
                        ]
                    }
                ]
            }
        });

But i get the below error

TypeError: Cannot read property 'template' of undefined
at QueryBuilder.
at Array.forEach (native)

I tried bypassing it by providing templates: [] , but that leads to another error as below:

TypeError: this.templates.group is not a function
at QueryBuilder.getGroupTemplate (vendor.bundle.js:127034)
at QueryBuilder.setRoot (vendor.bundle.js:125226)
at QueryBuilder.setRules (vendor.bundle.js:126177)
at new QueryBuilder

Can you please point me to the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIdentified bug which needs a fix

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions