2017-07-15 130 views
0

這個問題已被問及幾次回答,但沒有答案爲我工作。tablesorter不顯示錶上的箭頭

我最近從JQuery 1.x更新到3.x,那是當箭頭消失。

下面是代碼:

<html> 
    <head> 
    <title>Inspections</title> 
    <link rel="Stylesheet" href="css/theme.blue.css" type="text/css" /> 
    <script type="text/javascript" src="js/jquery-3.2.1.js"></script> 
    <script type="text/javascript" src="js/jquery.tablesorter.min.js"></script> <!-- 2.17.8 --> 

    </head> 
    <body> 
     <div id='inspectionoutstandingdiv'> 
     <h1>Inspections 
     </h1> 
     <table id='activeinspections' class='tablesorter'> 
     <thead> 
     <tr> 
     <th>Field 1 </th> 
     <th>Field 2 </th> 
     </tr> 
     </thead> 
     <tbody> 
     <tr> 
     <td>Some Data 1 </td> 
     <td>Some Data 2 </td> 
     </tr> 
     </tbody> 
     </table> 
     </div> 
     <script type="text/javascript"> 
      $('#activeinspections').tablesorter({theme:'blue'}); 
     </script> 
    </body> 
</html> 

其中一個建議是讓放置在正確的停止或修改CSS爲指向的.gif文件的.gif文件,但是當我打開up theme.blue.css我注意到.gif文件作爲編碼文本嵌入在.css中。

我用瀏覽器調試程序運行,看它是否在抱怨無法加載的文件。

此代碼在jq和tablesorter的較早版本中使用,這些版本使用箭頭的單個.gif文件。

我做錯了,箭頭沒有顯示出來?

每個Mottie的建議我加了theme: 'blue'到tablesorter調用,但是沒有幫助。

然後,我將class='tablesorter'更改爲class='tablesorter-blue'並且工作正常。我不認爲這是一個理想的解決方案,所以我仍然想要一個答案。

+0

(https://mottie.github.io/tablesorter/docs/)你需要添加['theme'選項](https://mottie.github.io/tablesorter/docs/#theme)...將其設置爲'theme:'blue''。 – Mottie

+0

我添加了{theme:'blue'},它仍然不添加箭頭。分類工作(就像以前一樣)。 –

+0

你確定主題的css文件正在加載嗎? – Mottie

回答

1

問題是我正在使用一個名爲Mottie-tablesorter-08bf513.zip的.zip文件,我應該直接從github下載Mottie的代碼。

正確的代碼有一個評論說,看起來是這樣的:如果你使用我的[的tablesorter的叉]

/*! TableSorter (FORK) v2.xx.xx *//*