Is there a way to query a model condition to see if it is or is not currently active?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Is there a way to query a model condition to see if it is or is not currently active?  In something i am working on, I'd use the status of the condition to go down one of two paths in the logic.
Photo of Eric Tuggle

Eric Tuggle

  • 342 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
There is an inactive property on Model Conditions that will be false if a Condition is active, trueif it is inactive.
Photo of Eric Tuggle

Eric Tuggle

  • 342 Points 250 badge 2x thumb
could you share the syntax used within an if statement in a snippet?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
var model = skuid.$M('MyModel');
var condition = model.getConditionByName('MyConditionName',true);
var conditionIsActive = !condition.inactive;
Photo of Eric Tuggle

Eric Tuggle

  • 342 Points 250 badge 2x thumb
Thank. I've got everything working.