Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How can I capture the event object of kt.stepper?


I need to capture the even object of kt.stepper to conditionally perform some custom task and prevent the event stepper event from continue if condition not met, eg:

stepper.on("kt.stepper.click", function (event) {
doSomething(event)
});

function doSomething(eventObj) {
if (condition met) {
perrformTask;
} else {
eventObj.preventDefault();
}
}

I notice the event argument received is the stepper object instead of event object.

Thanks

You Meng


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

No problem, I manage to work around by triggering the function from kt.stepper.changed.

Thanks.

You Meng



Hi,

Glad to hear that. All the best with your projects!

Regards,
Sean



Hi,

Yes, currently the event as a param is not supported. Could you please explain your requirement and we will try to suggest you a workaround?

You can attack a custom event handler to the stepper control elements since they are available in the HTML and you can handle it as you wish.

Regards,
Sean


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(