mistic100 / jQuery-QueryBuilder

jQuery plugin offering an interface to create complex queries
https://querybuilder.js.org
MIT License
1.68k stars 552 forks source link

Creating more than one query builder doesn't work #158

Closed HisssProgramacion closed 9 years ago

HisssProgramacion commented 9 years ago

Hi! I'm trying to put more than one query builder in the same page by a dynamic form, the problem is when I create another query builder, the previous builder doesn't work anymore... Here is an example of HTML code that dynamically add: HTML:

<div class="panel panel-default" id="panel-filtro1">
    <div class="panel-body" id="filtro1"></div>
</div>

And then I run this script: $('#filtro1').queryBuilder({filters: [//here i put all my filters]});

And when I add another, changing the names to "filtro2", the query builder of filtro1 stops working. I mean, the buttons doesn't do anything in "filtro1", but in "filtro2" everything runs ok. But if I add another builder, like "filtro3", then "filtro2" stops working too. How can I solve it?

mistic100 commented 9 years ago

How do you think this work ? http://mistic100.github.io/jQuery-QueryBuilder/demo.html Provide a real example on jsfiddle or anywhere else

HisssProgramacion commented 9 years ago

So whats my problem? are the names of the div elements or another thing? its there any problem if I use xajax for append the html when I click on a button?

mistic100 commented 9 years ago

Quoting myself

Provide a real example on jsfiddle or anywhere else