question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `values` instead of `value` when having multiple values

See original GitHub issue

Thank you for this awesome package.

I noticed that the getRules() function return the user’s selected in a property called value. Value is a string in most time, unless between or multiple select is used then it is changed to an array.

If there a way to override the default behavior so that if the values are array of strings, then put them in a new property called values while if the property is a single string it can stay in the value property. This will make parsing the object easier with c# or ASP.NET MVC framework.

Thank you

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mistic100commented, Apr 24, 2017

Use changers. http://querybuilder.js.org/#events

// it's a bit unreadable because the first "value" is the value contained by the event (the rule)
// and the second "value" is the actual rule value
$('#builder').on('ruleToJson.queryBuilder.filter', function(e) {
  if (Array.isArray(e.value.value)) {
    e.value.values = e.value.value;
    delete e.value.value;
  }
});

Please do not close the issue, I think I will make it the default in version 3

0reactions
malhayek2014commented, Apr 24, 2017

when when using “in” or “not_in” use the value_separator to parse the string and store the result in values and delete value It’ll be one other less step that the user will have to do

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to use LIKE instead of IN with multiple values?
Using LIKE against a subquery that returns multiple records won't work. A solution would be to turn the IN condition to an EXISTS...
Read more >
7.10.1. Constructs for Handling Multiple Values
This works because values returns exactly one value for each of its argument forms; as for any function call, if any argument form...
Read more >
Use SELECTEDVALUE instead of VALUES in DAX
The use of the HASONEVALUE is a defensive technique. It's required because it's possible that multiple values filter the Country-Region column.
Read more >
How to VLOOKUP multiple values in Excel with criteria - Ablebits
See how to Vlookup multiple matches in Excel based on one or more conditions and return multiple values in a column, row or...
Read more >
Variables with multiple values / David Cavazos - Observable
Just like getting a value, we can also set a value with the object[property] operator. setPropertyOfObjectByName = ƒ(object, property, value). Object {plant ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found