EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Fabrice on October 02, 2014, 11:45:38 PM



Title: getting event when click on linkbutton for Firefox
Post by: Fabrice on October 02, 2014, 11:45:38 PM
Is-it possible to have event param passed by linkbutton onclick event?
I need to show dialog at mouse position when user click on a button, but mouse position is in event.pageX and event.pageY, problem with Firefox is that event variable is not known, i test this change and it work for me, but do you think it's possible to have this in next version?
Code:
.bind("blur.linkbutton",function(){
$(this).removeClass("l-btn-focus");
}).bind("click.linkbutton",function(e){
if(!_8c.disabled){
if(_8c.toggle){
if(_8c.selected){
$(this).linkbutton("unselect");
}else{
$(this).linkbutton("select");
}
}
_8c.onClick.call(this,e);
}
or maybe you have another solution?


Title: Re: getting event when click on linkbutton for Firefox
Post by: jarry on October 03, 2014, 01:17:41 AM
You can bind the 'click' event directly to the linkbutton.
Code:
<a id="btn" href="#" class="easyui-linkbutton">...</a>
<script>
$(function(){
  $('#btn').bind('click', function(e){
    //...
  });
});
</script>


Title: Re: getting event when click on linkbutton for Firefox
Post by: Fabrice on October 03, 2014, 07:57:32 AM
Thank you, it's working with your solution.