This is a migrated thread and some comments may be shown as answers.

Asp.Net core Stepper - Select event not triggered when page loads

1 Answer 230 Views
Stepper
This is a migrated thread and some comments may be shown as answers.
Janine
Top achievements
Rank 1
Janine asked on 25 May 2020, 06:50 PM

I have this stepper that I am forcing the selection to index 2. 

-- this is the script part

$(document).ready(function () {
        var stepper = $("#meetingSessionStepper").data("kendoStepper");
        stepper.select(2);
        
    });

function onSelectStep(e) {

       ----- This is not triggered when the page loads
       
    }

 

--- this is the control

 @(Html.Kendo().Stepper()
            .Name("meetingSessionStepper")
            .Linear(false)
            .Orientation(StepperOrientationType.Horizontal)
            .Steps(s =>
            {
                s.Add().Label("Preparation");
                s.Add().Label("Start Lesson");
                s.Add().Label("Attendance");
                s.Add().Label("Session Notes");
                s.Add().Label("End Lesson");
            })
            .Events(events => events.Select("onSelectStep"))
    )

But for some reason, my event method onSelectStep is not being triggered when the page loads. This method though is triggered when manually clicking the step from the stepper control.

 

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 27 May 2020, 02:44 PM

Hello, Janine,

Thank you for the provided code.

Programmatically selecting a Kendo UI Stepper causes the visual changes only. The event is not automatically triggered because this selection differs from the user's manual selection. What I can recommend is to trigger the select event manually:

$(document).ready(function () {
        var stepper = $("#meetingSessionStepper").data("kendoStepper");
        stepper.select(2);
        stepper.trigger('select', { node: 2 });

    });

Let me know if I can assist you any further.

 

Best Regards,
Anton Mironov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Stepper
Asked by
Janine
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or