0

レンダリングされたページをhttp://pub.admc.com/tmp/trivial.htmlに表示してください。 jQuery、Bootstrap、BootstrapがCDNから取得されていることがわかります。それぞれ、対応する製品ドキュメントの指示通りです。トリビアル「ブートストラップテーブル」(ドキュメントから貼り付けられない)はソート可能ではありません

3つの製品すべてが正常に読み込まれているようです。 JSONからテーブル・データをロードするように変更すると、JSONはテーブル・スケルトンを正常に移入しますが、まだソートできません。 Chrome JavaScriptコンソールは100%きれいに動作します。

doc reference table(ブートストラップ表:(ためのものであり、ドキュメントの種類のみ)によると、ブートストラップ・tablifiedのテーブルがデフォルトでソート可能にする必要があります。それでも私は、属性データ・ソート可能= trueを追加それは効果がありません。

<!DOCTYPE html> 
<html lang="en"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>Bootstrap Table samples</title> 
    <meta charset="utf-8"> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.0/bootstrap-table.min.css"> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.0/bootstrap-table.min.js"></script> 
<body> 
<table data-toggle="table"> 
    <thead> 
     <tr> 
      <th>Item ID</th> 
      <th>Item Name</th> 
      <th>Item Price</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
      <td>1</td> 
      <td>Item 1</td> 
      <td>$1</td> 
     </tr> 
     <tr> 
      <td>2</td> 
      <td>Item 2</td> 
      <td>$2</td> 
     </tr> 
    </tbody> 
</table> 
</body> 
</html> 

答えて

0

私はdata-sortable=trueにtable要素のデフォルトかかわらず、何もsortable=falseにすべての列のデフォルト以来、デフォルトでソートできないことを考え出した。

をデフォルトの状態では他のすべてを使用すると、追加することによって、列ごとに並べ替えを有効attr data-sortable=trueth要素。

関連する問題