最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Chosen - Binding to change event after Chosen is applied to select - Stack Overflow

programmeradmin0浏览0评论

I am currently using the jQuery Chosen plugin, and it is working well. Currently, I can bind to Chosen's change event like so:

$('#the_selector').chosen().change( ... );

And this works fine. I have encountered a case, however, where I need to bind to the change event after Chosen has already been applied to the select. Is there a way to do this?

I am currently using the jQuery Chosen plugin, and it is working well. Currently, I can bind to Chosen's change event like so:

$('#the_selector').chosen().change( ... );

And this works fine. I have encountered a case, however, where I need to bind to the change event after Chosen has already been applied to the select. Is there a way to do this?

Share Improve this question edited Mar 28, 2013 at 19:45 j0k 22.8k28 gold badges81 silver badges90 bronze badges asked Sep 28, 2012 at 8:03 HarryHarry 4,8357 gold badges42 silver badges70 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

I was able to bind to the event using:

$('#the_selector').on('change', function(){
    Do stuff
});

it uses the standard change event with some params as below

  $('.PayeeID').on('change', function (evt, params) {

     var selectedValue = params['selected']
     dosomthing(selectedValue);
}

params ==> has the selected value if it is single select

发布评论

评论列表(0)

  1. 暂无评论