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

Custom plugin not pulling from input field for value #901

Closed chalamministries closed 3 years ago

chalamministries commented 3 years ago

So I created a plugin that on getRuleInput.filter it generates a clickable list of options instead of checkboxes. Now I've tried iterating through all the ones selected and pushing them to an array and returning that array on valueGetter but that didnt work. So I created an input field and when a list item is clicked, it concats into the input field as a comma delimited (tried pipe delimited too) string. But when I try to get the rules or get sql, it throws validation error and says its empty. I unhid the input field so I could verify data in that field. But here's whats interesting.....even though I see the values getting added and subtracted from the string in the inputs value, it always returns empty UNLESS I manually click in that input field and type in it. Then it works as its supposed to. Documentation on this is not that great and looking at examples doesnt really explain much so there may be better ways to do this code. Your suggestions would be appreciated.

And here's the JS Fiddle for you. JS FIDDLE

chalamministries commented 3 years ago

OK so I had to trigger a change event after each click of a list item.