Tablesorter:无法单击标题中的下拉菜单 [英] Tablesorter: can not click pulldown in header

查看:97
本文介绍了Tablesorter:无法单击标题中的下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在头中,我有一个静态下拉列表,而不是更改后,将在下拉列表中选择的列中的数据重新加载到页面中. 如果我打开表排序器,则单击可对表进行排序,但无法访问下拉列表. 我已经完成了ccs的显示箭头,因此可以单击下拉菜单旁边的按钮进行排序.

In the head I have a static pulldown than when changed reloads the page with the data in the column selected in the pulldown. If I turn on tablesorter, clicking sorts the table but renders the pulldown inaccessible. I have done the ccs to show the arrows, so I can click next to the pulldown to sort.

所以我要实现的是: 单击head标记中的下拉列表旁边的即可对表格进行排序. 单击下拉列表将启用下拉列表(并重新加载).

So what I want to achieve is: Clicking next to the pulldown in the head tag should sort the table. Clicking the pulldown enables the pulldown (and does the reload).

PS jquery版本1.7.1(无法更新!)

PS jquery version 1.7.1 (can't update!)

基本代码:

<style>
    table.tablesorter thead tr div span {
        padding: 0px 8px;
        cursor: pointer;
    }
</style>
<table class="tablesorter">
<thead>
   <tr>
       <th class="header">
           <div>
                <span></span>
                Kolommen:
                <select>...</select>
           </div>
       </th>
       ...
 <script>
 <!--
     $(function() {
         $("table.tablesorter").tablesorter();
         $("select").on("click", function (e) {
             e.stopPropagation();
             // do something
         });
     });
 //-->
 </script>

...这不起作用.根据下面的建议,我现在离我们更近了,因为它在单击下拉菜单时会停止排序,但仍未打开它.

... which is not working. Based on the suggesting below I now am a step closer as now it stops sorting when clicking on the pulldown, but it is still not opening it.

推荐答案

使用以下代码...绑定到"mouseup",并防止传播停止点击以对列进行排序(

Use the following code... bind to "mouseup" and prevent propagation to stop the click from sorting the column (demo):

$('select').on('mouseup', function (e) {
    e.stopPropagation();
    // do something
});

这篇关于Tablesorter:无法单击标题中的下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆