Relation, when value not equal to something?
I'm submitting a
[ ] Bug / Regression
[ ] Feature Request / Proposal
[x] Question
I'm using
NG Dynamic Forms Version: 5.4.7
[ ] Basic UI
[ ] Bootstrap UI
[ ] Foundation UI
[ ] Ionic UI
[ ] Kendo UI
[ ] Material
[x] NG Bootstrap
[ ] Prime NG
Description
I'm trying to use related form controls and disable a question when a previous question is not equal to a particular value. In the example below I can disable the second question when the first question is equal to "test" and that works as expected, but I would like to disable the second question when the first question is not equal to a particular value
new DynamicFormGroupModel({
id: 'formGroup',
group: [
new DynamicInputModel(
{
id: 'firstQ',
label: 'First Question',
maxLength: 50,
},
),
new DynamicInputModel(
{
id: 'secondQ',
label: 'Second Question',
maxLength: 50,
relation: [
{
action: 'DISABLE',
when: [
{
id: 'firstQ',
value: 'test',
}
]
}
]
}
)
]
})
Is it possible to make that value test a negative test (value !== something)?
@udos86 ive got a sample I can give you which adds an operator field for these methods which allow multiple types of operators I.e. == === != >= > <= <
@bevbomb it would be awesome if you could!
@bevbomb it would be awesome if you could!
Hello, could you share these samples?
@AndreaRossiGit they have made some major changes to this package since I last worked on it and I'm afraid that my original work for handling relations doesn't work with the latest versions of this package. I can still, however, give you a sample of how I have been handling comparisons using operators. https://gist.github.com/bevbomb/1bbed68752e97d16d5146b77e314f768
@bevbomb how would i use this operator in my json to see if value is NOT null
@bevbomb how would i use this operator in my json to see if value is NOT null
{
"key": "someField",
"label": "Some Field",
"relation": [{
"action": "SHOW",
"connective": "AND",
"when": [{
"id": "anotherField",
"operator": "!=",
"value": "null"
}]
}]
}
thank you, how would i go about adding your gist code to my project?