Kendo UI for jQuery---03.组件___网格---03.从 HTML 表初始化网格

从 HTML 表初始化网格



  

若要将单元格的属性关联到可导航的 Kendo UI 网格中的相应列标题,请为每个元素定义 and 属性。
aria-describedby
id
data-index

  
    // Define the HTML table with rows, columns, and data.
    <table id="grid">
        <colgroup>
            <col />
            <col style="width:100px" />
        colgroup>
        <thead>
            <tr>
                <th data-field="title" data-filterable="false">Titleth>
                <th data-field="year" data-type="number" data-template="#=year#">Yearth>
            tr>
        thead>
        <tbody>
            <tr>
                <td>Star Wars: A New Hopetd>
                <td>1977td>
            tr>
            <tr>
                <td>Star Wars: The Empire Strikes Backtd>
                <td>1980td>
            tr>
        tbody>
    table>

    // Initialize the Grid.
    <script>

        $(document).ready(function(){
          $("#grid").kendoGrid({
            sortable: true,
            filterable: true
          });
        });

    script>

你可能感兴趣的:(Kendo,UI,jquery,html,javascript)