Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery tablesorter插件试图禁用标题排序,但它不起作用_Javascript_Php_Jquery_Html_Tablesorter - Fatal编程技术网

Javascript Jquery tablesorter插件试图禁用标题排序,但它不起作用

Javascript Jquery tablesorter插件试图禁用标题排序,但它不起作用,javascript,php,jquery,html,tablesorter,Javascript,Php,Jquery,Html,Tablesorter,因此,我有一个使用jQuery插件tablersorter(tablesorter.com)排序的表。我的表中有两个标题,我不想按它们排序,我正试图禁用它们。我使用了网站上提供的示例,但它似乎破坏了排序,根本不让我排序。这是我当前的代码 HTML 我不知道这是否解决了问题,但请尝试添加缺少的标记 <td><a href="/organizationDetails.php?id=<?=$curOrg->get('id');?>" class="btn btn-t

因此,我有一个使用jQuery插件tablersorter(tablesorter.com)排序的表。我的表中有两个标题,我不想按它们排序,我正试图禁用它们。我使用了网站上提供的示例,但它似乎破坏了排序,根本不让我排序。这是我当前的代码

HTML


我不知道这是否解决了问题,但请尝试添加缺少的标记

<td><a href="/organizationDetails.php?id=<?=$curOrg->get('id');?>" class="btn btn-tiny"><i class="fa fa-info-circle"></i></a>
        <?if($curOrg->get("clientId")>0){ ?>
            <button class="btn btn-danger btn-tiny" id="remove" data-uid="<?=$curOrg->get('id');?>" data-name="<?=$curOrg->get('name');?>"><i class="fa fa-trash"></i> </button>
        <?}?> // dont forget to close </td>


是否有任何tablersorter示例允许您生成2个标题?当您运行tablersorter函数时,默认情况下,它将使所有标题都可排序。我正在寻找使我的两个标题不再可排序,同时将其他标题保持为可排序。javascript控制台中的任何内容?tablesorter js语法看起来正确,不确定是否包含正确的版本,也不确定是否需要tablesorter小部件库。这是我包括的。不太清楚你所说的小部件库是什么意思。我对使用javascript/jQueryTanks有点陌生,我没有注意到它丢失了。但是,它没有解决这个问题。也感谢您提供有关php标记的提示。我正在使用的代码库有点旧,这就是为什么您看到php标记的方式。不过我正在慢慢地更新它。
    $(document).ready(function() { 
    $("orgTable").tablesorter({ 
        headers: { 
            4: { 
                sorter: false 
            }, 
            5: {               
                sorter: false 
            } 
        } 
    }); 
});
<td><a href="/organizationDetails.php?id=<?=$curOrg->get('id');?>" class="btn btn-tiny"><i class="fa fa-info-circle"></i></a>
        <?if($curOrg->get("clientId")>0){ ?>
            <button class="btn btn-danger btn-tiny" id="remove" data-uid="<?=$curOrg->get('id');?>" data-name="<?=$curOrg->get('name');?>"><i class="fa fa-trash"></i> </button>
        <?}?> // dont forget to close </td>