Igor Bobko
Igor Bobko

Reputation: 342

How to emulate event in Kendo UI

I wanna to emulate change event when page is loaded, but i try some things and nothing works(:

jQuery(function($){

                        var data = $('[name="carriage"]').data('kendoDropDownList');
                        data.setOptions({
                            'change':function(v) {
                                $('[id^="carriageWindow"]').css('display','none');
                                $('#carriageWindow' + v.sender.value()).css('display','block');
                            }
                        });
                        data.select(1); //not works
                        data.bind("change"); //not works

                        data.change(); //not works

                    });

Upvotes: 1

Views: 54

Answers (1)

dfsq
dfsq

Reputation: 193261

Try this:

// select second option
data.select(1);

// trigger change event
data.trigger('change');

Demo: http://plnkr.co/edit/fqhBSf5VU0SD6STiCgpY?p=preview

Upvotes: 2

Related Questions