Closed landy2005 closed 6 years ago
Hrm, seems this happen because that field not have filter values, taginput is select but with empty initial array.
Could you create a simple repro ? I won't try the find the interesting stuff in your script.
Hrm, I tried to reproduce in jsfiddle, but I did not succeed, I'm not js expert. I can give access (privately) to my dev wui, where I can show example.
But bassically trouble in that bs-tagsinput plugin allow insert freestring as select item (not known in advance). setRules - not allowed to set "unknown before by filter" select items.
Tagsinput have methods for add items, but I not know how use it for QB: https://github.com/bootstrap-tagsinput/bootstrap-tagsinput
I'm sorry I don't have time to investigate from scratch.
For what I see you probably need to use the "valueGetter" and "valueSetter" filter methods to synchronize the plugin with the builder, check the examples.
Yah, seems as I fixed for self by valueSetter:
valueSetter: function(rule, value) {
var rule_container = rule.\$el.find('.rule-value-container select');
for (i = 0; i < value.length; ++i) { rule_container.tagsinput('add', value[i]); }
}
Based on you suggestions in #659 I created rule(s) with this plugin. Add new rules, worked correctly, but not possible to edit. Stored values not passed into tagsinput field.
In this example, entity.ipv4_address (port.ipv4_address) is array, in setRules method:
And main JS (sorry for long copy-paste, script generated):