开发者

How to simulate an event with jQuery?

I am working with a third party plugin, that has a small bug. This bug happens when the control renders, and when I doubleclick on a header row inside the table it fixes my problem through this trigger inside the plug开发者_如何学JAVAin:

$(".grid tr").live("dblclick",function() {
    //code here 
});

So, what I need is, knowing the exact <tr>, I want to simulate that double click, so I can fix the bug on the control onload callback.

Is this even possible?


$(".grid tr").trigger("dblclick");

This will trigger the double click event.

If there is indeed a bug with the plugin, you should create a bug report with them so hopefully they can (a) tell you are doing it wrong, here is how to do it right or (b) fix it in a future release.


$(".grid tr").trigger('dblclick');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜