<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Backgrid.jsHTML 表格組件

          聯(lián)合創(chuàng)作 · 2023-10-02 13:37

          Backgrid.js 是一個基于 Backbone.js 用于構建語義和容易樣式化的 HTML 表格組件。提供簡單、直觀的編程接口。

          示例代碼:

          var Territory = Backbone.Model.extend({});
          
          var Territories = Backbone.Collection.extend({
            model: Territory,
            url: "examples/territories.json"
          });
          
          var territories = new Territories();
          
          // Fetch some countries from the url
          territories.fetch();
          
          // Column definitions
          var columns = [{
            name: "id", // The key of the model attribute
            label: "ID", // The name to display in the header
            editable: false, // By default every cell in a column is editable, but *ID* shouldn't be
            // Defines a cell type, and ID is displayed as an integer without the ',' separating 1000s.
            cell: Backgrid.IntegerCell.extend({
              orderSeparator: ''
            })
          }, {
            name: "name",
            label: "Name",
            // The cell type can be a reference of a Backgrid.Cell subclass, any Backgrid.Cell subclass instances like *id* above, or a string
            cell: "string" // This is converted to "StringCell" and a corresponding class in the Backgrid package namespace is looked up
          }, {
            name: "pop",
            label: "Population",
            cell: "integer" // An integer cell is a number cell that displays humanized integers
          }, {
            name: "percentage",
            label: "% of World Population",
            cell: "number" // A cell type for floating point value, defaults to have a precision 2 decimal numbers
          }, {
            name: "date",
            label: "Date",
            cell: "date",
          }, {
            name: "url",
            label: "URL",
            cell: "uri" // Renders the value in an HTML <a> element
          }];
          
          // Initialize a new Grid instance
          var grid = new Backgrid.Grid({
            columns: columns,
            collection: pageableTerritories,
            footer: Backgrid.Paginator
          });
          
          // Render the grid and attach the root to your HTML document
          $("#example-1-result").append(grid.render().$el);
          瀏覽 17
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  午夜福利剧场 | 日韩传媒中文字幕一区 | www.黄色在线观看 | 日韩精品免费一区二区三区夜夜嗨 | 欧美日韩丁香五月天色网 |