Dinamically add steps progressbar layout problem.

1 Answer 86 Views
Forms Stepper Styling
vinicius
Top achievements
Rank 1
vinicius asked on 02 Jul 2024, 10:36 AM
Hi all,
I'm trying to include steps dinamically, using stepper componenet, everything works fine, but, i have this layout problem with the progress bar.


as you can see, the progress bar don't follow the layout when i add more steps in real time.
Just for explanations, this layout starts with 2 steps, and user can add more steps.

1 Answer, 1 is accepted

Sort by
1
Accepted
Zornitsa
Telerik team
answered on 05 Jul 2024, 05:37 AM

Hi Vinicius,

Thank you for the provided screenshot.

To add steps dynamically to the Stepper component, the developer needs to also update the reference of the steps collection after adding the new steps in order to properly reflect the changes in the view. This can be achieved with the spread operator (...) for example:

public addStep(): void {
    this.steps.push({ label: 'Attachments' });
    this.steps = [...this.steps];
}

For a demonstration of the above approach, please refer to the following StackBlitz example:

A more detailed explanation regarding reflecting the changes in the view after manually updating the data of a Kendo UI for Angular component can be found in the following Knowledge Base article from our documentation:

I hope this helps.

Regards,
Zornitsa
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
vinicius
Top achievements
Rank 1
commented on 05 Jul 2024, 08:27 AM

It worked perfectly, thanks.
Tags
Forms Stepper Styling
Asked by
vinicius
Top achievements
Rank 1
Answers by
Zornitsa
Telerik team
Share this question
or