ui.igTreeGridColumnMoving

ui.igTreeGridColumnMoving_image

igTreeGrid コントロールは列移動機能があります。列移動機能を使用すると、グリッドの列の順序を変更できます。列移動機能は 2 つのモードがあります:

immediate モードは、ドラッグの間に列ヘッダーを移動し、列の切り替えにアニメーションを追加します。列のコンテンツの移動は、列ヘッダーをドロップした後に実行されます。

deferred モードは、列のドロップする位置を示す矢印を使用します。

この API のクラス、オプション、イベント、メソッドおよびテーマに関する詳細は、上記の関連するタブを参照してください。

以下のコード スニペットは、igTreeGrid コントロールと列移動機能を初期化する方法を示します。

この API を使用して作業を開始するための情報はここをクリックしてください。 igGrid コントロールの必要なスクリプトおよびテーマを参照する方法については、 「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 src="js/infragistics.lob.js" type="text/javascript"></script>
 
      <script type="text/javascript">
          var employees = [
              { "employeeId": 0, "supervisorId": -1, "firstName": "Andrew", "lastName": "Fuller" },
              { "employeeId": 1, "supervisorId": -1, "firstName": "Jonathan", "lastName": "Smith" },
              { "employeeId": 2, "supervisorId": -1, "firstName": "Nancy", "lastName": "Davolio" },
              { "employeeId": 3, "supervisorId": -1, "firstName": "Steven", "lastName": "Buchanan" },
 
              // Andrew Fuller's direct reports
              { "employeeId": 4, "supervisorId": 0, "firstName": "Janet", "lastName": "Leverling" },
              { "employeeId": 5, "supervisorId": 0, "firstName": "Laura", "lastName": "Callahan" },
              { "employeeId": 6, "supervisorId": 0, "firstName": "Margaret", "lastName": "Peacock" },
              { "employeeId": 7, "supervisorId": 0, "firstName": "Michael", "lastName": "Suyama" },
 
              // Janet Leverling's direct reports
              { "employeeId": 8, "supervisorId": 4, "firstName": "Anne", "lastName": "Dodsworth" },
              { "employeeId": 9, "supervisorId": 4, "firstName": "Danielle", "lastName": "Davis" },
              { "employeeId": 10, "supervisorId": 4, "firstName": "Robert", "lastName": "King" },
 
              // Nancy Davolio's direct reports
              { "employeeId": 11, "supervisorId": 2, "firstName": "Peter", "lastName": "Lewis" },
              { "employeeId": 12, "supervisorId": 2, "firstName": "Ryder", "lastName": "Zenaida" },
              { "employeeId": 13, "supervisorId": 2, "firstName": "Wang", "lastName": "Mercedes" },
 
              // Steve Buchanan's direct reports
              { "employeeId": 14, "supervisorId": 3, "firstName": "Theodore", "lastName": "Zia" },
              { "employeeId": 15, "supervisorId": 3, "firstName": "Lacota", "lastName": "Mufutau" },
 
              // Lacota Mufutau's direct reports
              { "employeeId": 16, "supervisorId": 15, "firstName": "Jin", "lastName": "Elliott" },
              { "employeeId": 17, "supervisorId": 15, "firstName": "Armand", "lastName": "Ross" },
              { "employeeId": 18, "supervisorId": 15, "firstName": "Dane", "lastName": "Rodriquez" },
 
              // Dane Rodriquez's direct reports
              { "employeeId": 19, "supervisorId": 18, "firstName": "Declan", "lastName": "Lester" },
              { "employeeId": 20, "supervisorId": 18, "firstName": "Bernard", "lastName": "Jarvis" },
 
              // Bernard Jarvis' direct report
              { "employeeId": 21, "supervisorId": 20, "firstName": "Jeremy", "lastName": "Donaldson" }
          ];
 
        $(function () {
             $("#treegrid").igTreeGrid({
                 dataSource: employees,
                 primaryKey: "employeeId",
                 foreignKey: "supervisorId",
                 width: "900px",
                 autoGenerateColumns: false,
                 columns: [
                     { headerText: "ID", key: "employeeId", width: "300px", dataType: "number" },
                     { headerText: "First", key: "firstName", width: "300px", dataType: "string" },
                     { headerText: "Last", key: "lastName", width: "300px", dataType: "string" }
                 ],
                 features: [
                  {
                       name: "ColumnMoving"
                  }]
             });
         });
      </script>
  </head>
  <body>
      <table id="treegrid"></table>
  </body>
</html>

関連サンプル

関連トピック

依存関係

jquery-1.9.1.js
jquery.ui.core.js
jquery.ui.widget.js
infragistics.datasource.js
infragistics.ui.shared.js
infragistics.ui.treegrid.js
infragistics.util.js
infragistics.ui.grid.framework.js
infragistics.ui.grid.columnmoving.js

継承

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