0

jquery datatablesプラグインをセットアップしようとしていますが、レンガの壁にぶつかりました。これまでのところ、次のようになりました...「testtable.php」というページを作成しました。次のようになります。それは内容です。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cloudone Chart Of Accounts</title>

<script type="text/javascript" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>

<script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
    $('#example').dataTable( {
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "server_processing.php"


    } );
} );

        </script>
        <link href="css/demo_table.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="101%" border="0" class="display" id="example">
<thead>
  <tr>
    <th width="32%" scope="col">Rendering Engine;</th>
    <th width="28%" scope="col">&nbsp;</th>
    <th width="10%" scope="col">&nbsp;</th>
    <th width="10%" scope="col">&nbsp;</th>
    <th width="10%" scope="col">&nbsp;</th>
    <th width="10%" scope="col">&nbsp;</th>
  </tr>
  </thead>
  <tbody>
  <tr>
    <td>engine</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </tbody>
</table>

</body>
</html>

datatables.netが提供するサンプルを使用して、必要な接続設定を入力した「server_processing.php」という2番目のページを作成し、テストサーバーに「testtable.php」と入力しました。datatables.netで概説されている基本構成を使用して、動作を理解するためにいろいろと試してみることができます。これは私が困惑している場所であり、ページをレンダリングするためのページを取得できません。結果。表示ページ「testtable.php」に表示する変数を定義するプロセスだけでなく、接続で何かを省略しているのではないかと思います。

誰かが私がどこに迷っているのかを指摘したり、jquerydatatablesサーバー側処理のステップバイステップのセットアップ例を参照したりできますか?

デビッドありがとう

4

1 に答える 1

0

サーバーサイド処理なしで開始するには(行が多すぎて問題ない場合)

今と同じようにHTMLページを作成し、テーブルにデータを入力します

それで:

<table width="101%" border="0" class="display" id="example">
    <thead>
        <tr>
            <th width="32%" scope="col">Rendering Engine;</th>
            <th width="28%" scope="col">&nbsp;</th>
            <th width="10%" scope="col">&nbsp;</th>
            <th width="10%" scope="col">&nbsp;</th>
            <th width="10%" scope="col">&nbsp;</th>
            <th width="10%" scope="col">&nbsp;</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>engine</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>engine1</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>engine1</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>

そして、オプションなしでデータテーブルを初期化するだけです。

ライブの例については、これを参照してください:http: //jsfiddle.net/V97jd/

于 2013-02-24T15:09:52.713 に答える