Search code examples
javascriptkendo-uiclicksimulate

How to simulate click on Kendoui button


Where is a problem? I fire click event and nothing happens:

<button id="btn_test">Test</button>
$('#btn_test').kendoButton();
var btn = $("#btn_test").data("kendoButton");
$(btn).click() // nothing happens

Solution

  • Suggested method:

    $(btn).trigger('click') 
    

    does not work again, but this one does work:

    $('#btn_test').trigger('click');