ig.HtmlTableDataSource

ig.HtmlTableDataSource_image

HtmlTableDataSource は DataSource クラスを拡張したもであり、デフォルトで、タイプ オプションを「htmlTableDom」に設定します。HtmlTableDataSource コンポーネントの API の詳細については、DataSource コンポーネントの API マニュアルを参照してください。この API のクラス、オプション、イベント、メソッドおよびテーマの詳細については、上記の関連するタブを参照してください。

以下のコードは、HtmlTableDataSource コントロールの初期化方法を示します。

この API を使用した作業方法の詳細についてはここをクリックしてください。HtmlTableDataSource コントロールの必要なスクリプトおよびテーマを参照する方法については、 「Ignite UI で JavaScript リソースを使用する」および Ignite UI のスタイル設定とテーマを参照してください。

コード サンプル

<!doctype html>
<html>
<head>
    <!-- Infragistics Combined CSS -->
    <link href="css/themes/infragistics/infragistics.theme.css" rel="stylesheet" type="text/css" />
    <link href="css/structure/infragistics.css" rel="stylesheet" type="text/css" />
    <!-- jQuery Core -->
    <script src="js/jquery.js" type="text/javascript"></script>
    <!-- jQuery UI -->
    <script src="js/jquery-ui.js" type="text/javascript"></script>
    <!-- Infragistics Combined Scripts -->
    <script src="js/infragistics.core.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
 
            var tableSchema = new $.ig.DataSchema("htmlTableDom",
            { fields:
                [
                    { name: "FirstName" },
                    { name: "LastName" },
                    { name: "Email" }
                ]
            });
 
            var data = $("#tableData")[0];
 
            var ds = new $.ig.HtmlTableDataSource({
                dataSource: data,
                schema: tableSchema
            });
 
            ds.dataBind();
            var template = "<tr><td>${Email}</td><td>${FirstName}</td><td>${LastName}</td></tr>",
            resultHtml = $.ig.tmpl(template, ds.dataView());
            $("#t1").html(resultHtml);
        });
    </script>
</head>
<body>
    <h2>Source HTML</h2>
    <table id="tableData">
        <tr>
            <td>Gustavo</td>
            <td>Achong</td>
            <td>gustavo@adventure-works.com</td>
        </tr>
        <tr>
            <td>Catherine</td>
            <td>Abel</td>
            <td>catherine0@adventure-works.com</td>
        </tr>
        <tr>
            <td>Kim</td>
            <td>Abercrombie</td>
            <td>kim2@adventure-works.com</td>
        </tr>
    </table>
    <h2>Templated Schema</h2>
    <table id="t1" class="standard-grid">
        <thead></thead>
        <tbody></tbody>
    </table>
</body>
</html>

関連サンプル

関連トピック

依存関係

jquery-1.9.1.js
infragistics.util.js
infragistics.util.jquery.js

Copyright © 1996 - 2025 Infragistics, Inc. All rights reserved.