<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>

          jQuery Grid PluginjQuery 擴展插件

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

          jQuery Grid 是一個 jQuery Javascript 庫的插件。一個非常快的、可擴展的工具,能高級交互控件添加任何 HTML 。支持分頁、 javascript 服務器數(shù)據(jù)、 jQuery UI 引導(Bootstrap。

          HTML:

          <button id="btnAdd">Add Row</button>
              <br><br>
              <table id="grid"></table>
              <div id="dialog" style="display:none">
                  <input id="ID" type="hidden">
                  <table border="0">
                      <tbody><tr>
                          <td><label for="Name">Name:</label></td>
                          <td><input id="Name" type="text"></td>
                      </tr>
                      <tr>
                          <td><label for="PlaceOfBirth">Place Of Birth:</label></td>
                          <td><input id="PlaceOfBirth" type="text"></td>
                      </tr>
                  </tbody></table>
              </div>

          JavaScript:

          $(document).ready(function () {
              var data, grid, dialog;
              data = [
                  { "ID": 1, "Name": "Hristo Stoichkov", "PlaceOfBirth": "Plovdiv, Bulgaria" },
                  { "ID": 2, "Name": "Ronaldo Luís Nazário de Lima", "PlaceOfBirth": "Rio de Janeiro, Brazil" },
                  { "ID": 3, "Name": "David Platt", "PlaceOfBirth": "Chadderton, Lancashire, England" }
              ];
              dialog = $("#dialog").dialog({
                  title: "Add/Edit Record",
                  autoOpen: false,
                  resizable: false,
                  modal: true,
                  buttons: {
                      "Save": Save,
                      "Cancel": function () { $(this).dialog("close"); }
                  }
              });
              function Edit(e) {
                  $("#ID").val(e.data.id);
                  $("#Name").val(e.data.record.Name);
                  $("#PlaceOfBirth").val(e.data.record.PlaceOfBirth);
                  $("#dialog").dialog("open");
              }
              function Delete(e) {
                  if (confirm("Are you sure?")) {
                      grid.removeRow(e.data.id);
                  }
              }
              function Save() {
                  if ($("#ID").val()) {
                      var id = parseInt($("#ID").val());
                      grid.updateRow(id, { "ID": id, "Name": $("#Name").val(), "PlaceOfBirth": $("#PlaceOfBirth").val() });
                  } else {
                      grid.addRow({ "ID": grid.count() + 1, "Name": $("#Name").val(), "PlaceOfBirth": $("#PlaceOfBirth").val() });
                  }
                  $(this).dialog("close");
              }
              grid = $("#grid").grid({
                  dataSource: data,
                  columns: [
                      { field: "ID" },
                      { field: "Name" },
                      { field: "PlaceOfBirth", title: "Place Of Birth" },
                      { title: "", width: 20, type: "icon", icon: "ui-icon-pencil", tooltip: "Edit", events: { "click": Edit } },
                      { title: "", width: 20, type: "icon", icon: "ui-icon-close", tooltip: "Delete", events: { "click": Delete } }
                  ]
              });
              $("#btnAdd").on("click", function () {
                  $("#ID").val("");
                  $("#Name").val("");
                  $("#PlaceOfBirth").val("");
                  $("#dialog").dialog("open");
              });
          });
          瀏覽 4
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

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

          手機掃一掃分享

          編輯 分享
          舉報
          <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>
                  黄色免费国产视频 | 无码高清一卡二卡免费视频 | 中文字幕日韩精品人妻无码 | 亚洲婷婷五月天 | AAAAAAAAAA黄片 |