Skip to content

Configuring Selectize from php #76

@nWidart

Description

@nWidart

Hi,

First of all, thank for building this great tool! 😃

I'm trying to use selectize plugin to make all my dropdowns as selectize instances. One important detail is that I make the filters array from a php script, which I return to the view using json_encode and place inside the filters key.

Something like the following:

$('#builder').queryBuilder({
    sortable: true,

    icons: {
        add_group: 'fa fa-plus',
        add_rule: 'fa fa-plus',
        remove_group: 'fa fa-times',
        remove_rule: 'fa fa-times',
        sort: 'fa fa-sort'
    },

    filters: <?php echo $filters; ?>
});

Only I'm wondering how to use selectize with this kind of structure. Since I can't make that closure you have in the example onInitialize, where you loop over every item to add it to selectize.
I do have the data in the values: key though, like a classic dropdown without plugins.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions