Is it possible to make child conditions "Filterable Default Off" and then use an action to "Active and Set Model Condition"
Skuidward Tentacles (Raymond), Champion
-
18,326 Points
Posted 3 years ago
Pat Vachon, Champion
-
45,236 Points
Skuidward Tentacles (Raymond), Champion
-
18,326 Points
Yep. (I think). I want to use a child template in a table, but I need to put conditions on the children that appear. The conditions on children fields in a model are "Always on". I'm wondering if I can hack xml to allow them to be set dynamically by a button then requery the whole model.
Also, I tried setting the condition to "in another model", but it doesn't seem to work. If I could get that working, I could accomplish what I am looking for by putting conditions on that other model.
Thanks!
Also, I tried setting the condition to "in another model", but it doesn't seem to work. If I could get that working, I could accomplish what I am looking for by putting conditions on that other model.
Thanks!
Pat Vachon, Champion
-
45,236 Points
Hmmm .... I'm sure it's possible one way or the other.
Shmuel Kamensky, Champion
-
4,700 Points
This works for now in javascript but be warned of Skuid's explicit lack of support for it.
You can do the same thing with setting the condition's value
NOTE
All properties in the Condition Metadata Object should be treated as read-only. Overwriting these values on the rendered page will result in undefined behavior and likely cause unexpected and undesirable results.
skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].inactive = true; // sets the sub condition to inactive
skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].inactive = active; // sets the sub condition to active
You can do the same thing with setting the condition's value
skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].value = singleValue; // sets the sub condition value if it's a single value condition
skuid.model.getModel('modelName').fieldsMap.Child_Relationship__r.subConditions[subConditionIndex].values = valueArray; // sets the sub condition value if it's a multi-value condition
Pat Vachon, Champion
-
45,216 Points
Yup. You did the digging I didn't want to. ;)
Shmuel Kamensky, Champion
-
4,700 Points
Ha I did the digging a while back. Just sharing the dirt now.
Karen Waldschmitt, Official Rep
-
9,082 Points
Thanks for digging and sharing the dirt :)