Skip to main content
vladimiir
Known Participant
November 10, 2017
Answered

Canvas component NumericStepper

  • November 10, 2017
  • 1 reply
  • 273 views

Canvas component NumericStepper

How to set max and min programmatically?

    This topic has been closed for replies.
    Correct answer UDESCO

    $("#InstanceName")[0].min = newMinValue;

    $("#InstanceName")[0].max = newMaxValue;

    However, these will not take effect if you place the script in the same frame when you add the component.

    You'll need to place the script in next frame after adding the component.

    Or, you can use it like below, which enforces the above script to be run only in the next frame after adding the component:

    this.on("tick", function () {

         $("#InstanceName")[0].min = newMinValue;

         $("#InstanceName")[0].max = newMaxValue;

    }, this , true);

    1 reply

    UDESCO
    UDESCOCorrect answer
    Participating Frequently
    November 10, 2017

    $("#InstanceName")[0].min = newMinValue;

    $("#InstanceName")[0].max = newMaxValue;

    However, these will not take effect if you place the script in the same frame when you add the component.

    You'll need to place the script in next frame after adding the component.

    Or, you can use it like below, which enforces the above script to be run only in the next frame after adding the component:

    this.on("tick", function () {

         $("#InstanceName")[0].min = newMinValue;

         $("#InstanceName")[0].max = newMaxValue;

    }, this , true);

    vladimiir
    vladimiirAuthor
    Known Participant
    November 10, 2017

    Thank you very much