Enable disabled stepper step by a variable

1 Answer 211 Views
Stepper Styling
lahiru
Top achievements
Rank 1
lahiru asked on 12 Aug 2022, 02:52 AM | edited on 13 Aug 2022, 03:27 PM

Initially instead of first step other steps are disabled. I want to enable them by button click. tried as follows but step still disabled.

 


public steps = [
    {
      class: "step1",
      label: "API Setup",
      iconClass: "k-icon k-i-file-bac"
      
    },
    {
      class: "step2",
      label: "File Upload",
      isValid: this.isStepValid,
      iconClass: "myicon1",
      disabled : this.disableStep2
    },
    {
      label: "Review",
      isValid: this.isStepValid,
      iconClass: "k-icon k-i-file-txt",
      disabled : this.disableStep3
    },
    {
      label: "Finish",
      isValid: this.isStepValid,
      iconClass: "k-icon k-i-file-txt",
      disabled : this.disableStep4
    },
  ];

1 Answer, 1 is accepted

Sort by
0
Accepted
Hetali
Telerik team
answered on 15 Aug 2022, 07:50 PM

Hello Lahiru,

In order to enable the steps on button click, update the steps.disabled value instead of modifying the variable disableStep. For example:

public i: number = 1;

public enableSteps() {
  if(this.steps[this.i]) {
    this.steps[this.i].disabled = false;
  }
}

In this StackBlitz example, I have enabled the steps on button click.

I hope this helps.

Regards,
Hetali
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

lahiru
Top achievements
Rank 1
commented on 17 Aug 2022, 01:37 PM

Hi Hetali,

It works. thanks

Tags
Stepper Styling
Asked by
lahiru
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or