如果是添加右键点击事件的话,可以采用官网提供的函数。
$("#dg").datagrid({onHeaderContextMenu:function(e, field){
alert("onHeaderContextMenu");
e.preventDefault();
}})
如果是添加左键单击事件,需要自己绑定。
<table id="dg" class="easyui-datagrid" title="Client Side Pagination" style="width:700px;height:300px">
<thead>
<tr>
<th id="inv_th" field="inv" width="80">Inv No</th>
</tr>
</thead>
</table>
///////////////////////////////////////////////////////
js绑定
$("#inv_th").click(function(){
alert("xxxxx")
});
本文介绍了如何在EasyUI的Datagrid组件中绑定右键点击和左键单击事件。对于右键事件,可以直接使用EasyUI提供的onHeaderContextMenu函数;而左键事件则需要通过jQuery手动绑定。

1032

被折叠的 条评论
为什么被折叠?



