igniteui-cli 8.2.0 → 8.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/lib/commands/build.js +3 -0
  2. package/lib/commands/start.js +4 -1
  3. package/lib/templates/ReactTemplate.d.ts +4 -4
  4. package/lib/templates/ReactTemplate.js +42 -29
  5. package/package.json +4 -4
  6. package/templates/react/es6/bar-chart/default/files/{client → src}/components/__path__/index.js +2 -4
  7. package/templates/react/es6/{column-chart/default/files/client → bar-chart/default/files/src}/data/world-energy-production.js +2 -2
  8. package/templates/react/es6/column-chart/default/files/{client → src}/components/__path__/index.js +2 -6
  9. package/templates/react/es6/{bar-chart/default/files/client → column-chart/default/files/src}/data/world-energy-production.js +0 -0
  10. package/templates/react/es6/combo/combo/files/{client → src}/components/__path__/index.js +2 -4
  11. package/templates/react/es6/doughnut-chart/doughnut-chart/files/{client → src}/components/__path__/index.js +1 -4
  12. package/templates/react/es6/editors/editors/files/{client → src}/components/__path__/index.js +1 -4
  13. package/templates/react/es6/financial-chart/financial-chart/files/{client → src}/components/__path__/index.js +1 -5
  14. package/templates/react/es6/financial-chart/financial-chart/files/{client → src}/data/financial-data.js +1 -1
  15. package/templates/react/es6/funnel-chart/funnel-chart/files/{client → src}/components/__path__/index.js +1 -4
  16. package/templates/react/es6/generate/files/{client → src}/components/__path__/index.js +1 -1
  17. package/templates/react/es6/grid/basic/files/{client → src}/components/__path__/index.js +10 -12
  18. package/templates/react/es6/grid/grid-custom/files/{client → src}/components/__path__/index.js +10 -13
  19. package/templates/react/es6/grid/grid-editing/files/{client → src}/components/__path__/index.js +10 -13
  20. package/templates/react/es6/grid/grid-export/files/src/components/__path__/index.js +124 -0
  21. package/templates/react/es6/grid/grid-export/files/{client/components/__path__/styles.scss → src/components/__path__/styles.css} +0 -0
  22. package/templates/react/es6/grid/grid-export/index.js +2 -1
  23. package/templates/react/es6/grid/grid-templating/files/{client → src}/components/__path__/index.js +1 -5
  24. package/templates/react/es6/grid/grid-templating/files/{client → src}/components/__path__/northwind.js +0 -0
  25. package/templates/react/es6/hierarchical-grid/hierarchical-grid/files/{client → src}/components/__path__/index.js +1 -5
  26. package/templates/react/es6/hierarchical-grid/{hierarchical-grid-export/files/client → hierarchical-grid/files/src}/components/__path__/northwind.js +0 -0
  27. package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/src/components/__path__/index.js +82 -0
  28. package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/{client → src}/components/__path__/northwind.js +0 -0
  29. package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/files/src/components/__path__/index.js +81 -0
  30. package/templates/react/es6/hierarchical-grid/{hierarchical-grid/files/client → hierarchical-grid-editing/files/src}/components/__path__/northwind.js +5587 -5587
  31. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/src/components/__path__/index.js +112 -0
  32. package/templates/react/es6/hierarchical-grid/{hierarchical-grid-editing/files/client → hierarchical-grid-export/files/src}/components/__path__/northwind.js +0 -0
  33. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/src/components/__path__/styles.css +13 -0
  34. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/index.js +2 -1
  35. package/templates/react/es6/index.js +1 -1
  36. package/templates/react/es6/line-chart/default/files/src/components/__path__/index.js +76 -0
  37. package/templates/react/es6/pie-chart/pie-chart/files/src/components/__path__/index.js +38 -0
  38. package/templates/react/es6/projects/empty/files/README.md +2 -5
  39. package/templates/react/es6/projects/empty/files/__dot__editorconfig +2 -2
  40. package/templates/react/es6/projects/empty/files/__dot__env +1 -0
  41. package/templates/react/es6/projects/empty/files/__dot__gitignore +18 -8
  42. package/templates/react/es6/projects/empty/files/ignite-ui-cli.json +20 -21
  43. package/templates/react/es6/projects/empty/files/package.json +33 -43
  44. package/templates/react/es6/projects/empty/files/public/favicon.ico +0 -0
  45. package/templates/react/es6/projects/empty/files/public/index.html +42 -0
  46. package/templates/react/es6/projects/empty/files/public/manifest.json +15 -0
  47. package/templates/react/es6/projects/empty/files/public/robots.txt +3 -0
  48. package/templates/react/es6/projects/empty/files/src/App.css +52 -0
  49. package/templates/react/es6/projects/empty/files/src/App.js +39 -0
  50. package/templates/react/es6/projects/empty/files/src/components/home/index.js +25 -0
  51. package/templates/react/es6/projects/empty/files/src/components/navigation-header/index.js +47 -0
  52. package/templates/react/es6/projects/empty/files/src/hoc/asyncComponent.js +50 -0
  53. package/templates/react/es6/projects/empty/files/src/igniteuiResources.js +7 -0
  54. package/templates/react/es6/projects/empty/files/src/index.css +13 -0
  55. package/templates/react/es6/projects/empty/files/src/index.js +23 -0
  56. package/templates/react/es6/projects/empty/files/src/reportWebVitals.js +13 -0
  57. package/templates/react/es6/projects/empty/files/src/routes.json +7 -0
  58. package/templates/react/es6/projects/empty/index.js +1 -8
  59. package/templates/react/es6/radial-chart/radial-chart/files/src/components/__path__/index.js +68 -0
  60. package/templates/react/es6/radial-chart/radial-chart/files/{client → src}/data/temperature.js +2 -2
  61. package/templates/react/es6/scatter-chart/scatter-chart/files/src/components/__path__/index.js +59 -0
  62. package/templates/react/es6/scatter-chart/scatter-chart/files/src/data/temperature.js +58 -0
  63. package/templates/react/es6/tree-grid/tree-grid/files/src/components/__path__/index.js +61 -0
  64. package/templates/react/es6/tree-grid/tree-grid-custom/files/src/components/__path__/index.js +62 -0
  65. package/templates/react/es6/tree-grid/tree-grid-editing/files/src/components/__path__/index.js +62 -0
  66. package/templates/react/es6/tree-grid/tree-grid-export/files/{client → src}/components/__path__/index.js +101 -103
  67. package/templates/react/es6/tree-grid/tree-grid-export/index.js +2 -1
  68. package/templates/react/igr-es6/projects/_base/files/README.md +1 -1
  69. package/templates/react/igr-es6/projects/_base/files/__dot__editorconfig +2 -2
  70. package/templates/react/igr-es6/projects/_base/files/__dot__env +1 -0
  71. package/templates/react/igr-es6/projects/top-nav/files/src/App.js +24 -21
  72. package/templates/react/es6/bar-chart/default/files/client/pages/__path__/index.js +0 -10
  73. package/templates/react/es6/column-chart/default/files/client/pages/__path__/index.js +0 -10
  74. package/templates/react/es6/combo/combo/files/client/pages/__path__/index.js +0 -10
  75. package/templates/react/es6/doughnut-chart/doughnut-chart/files/client/pages/__path__/index.js +0 -10
  76. package/templates/react/es6/editors/editors/files/client/pages/__path__/index.js +0 -10
  77. package/templates/react/es6/financial-chart/financial-chart/files/client/pages/__path__/index.js +0 -10
  78. package/templates/react/es6/funnel-chart/funnel-chart/files/client/pages/__path__/index.js +0 -10
  79. package/templates/react/es6/generate/files/client/pages/__path__/index.js +0 -11
  80. package/templates/react/es6/grid/basic/files/client/pages/__path__/index.js +0 -10
  81. package/templates/react/es6/grid/grid-custom/files/client/pages/__path__/index.js +0 -10
  82. package/templates/react/es6/grid/grid-editing/files/client/pages/__path__/index.js +0 -10
  83. package/templates/react/es6/grid/grid-export/files/client/components/__path__/index.js +0 -124
  84. package/templates/react/es6/grid/grid-export/files/client/pages/__path__/index.js +0 -10
  85. package/templates/react/es6/grid/grid-templating/files/client/pages/__path__/index.js +0 -10
  86. package/templates/react/es6/hierarchical-grid/hierarchical-grid/files/client/pages/__path__/index.js +0 -10
  87. package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/client/components/__path__/index.js +0 -85
  88. package/templates/react/es6/hierarchical-grid/hierarchical-grid-custom/files/client/pages/__path__/index.js +0 -10
  89. package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/files/client/components/__path__/index.js +0 -85
  90. package/templates/react/es6/hierarchical-grid/hierarchical-grid-editing/files/client/pages/__path__/index.js +0 -10
  91. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/client/components/__path__/index.js +0 -112
  92. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/client/components/__path__/styles.scss +0 -13
  93. package/templates/react/es6/hierarchical-grid/hierarchical-grid-export/files/client/pages/__path__/index.js +0 -10
  94. package/templates/react/es6/line-chart/default/files/client/components/__path__/index.js +0 -79
  95. package/templates/react/es6/line-chart/default/files/client/pages/__path__/index.js +0 -10
  96. package/templates/react/es6/pie-chart/pie-chart/files/client/components/__path__/index.js +0 -41
  97. package/templates/react/es6/pie-chart/pie-chart/files/client/pages/__path__/index.js +0 -10
  98. package/templates/react/es6/projects/empty/files/__dot__babelrc +0 -10
  99. package/templates/react/es6/projects/empty/files/__dot__eslintrc +0 -28
  100. package/templates/react/es6/projects/empty/files/__tests__/App.js +0 -19
  101. package/templates/react/es6/projects/empty/files/__tests__/App.spec.js +0 -11
  102. package/templates/react/es6/projects/empty/files/__tests__/CheckboxWithLabel.js +0 -31
  103. package/templates/react/es6/projects/empty/files/__tests__/CheckboxWithLabel.spec.js +0 -19
  104. package/templates/react/es6/projects/empty/files/__tests__/Sum.js +0 -6
  105. package/templates/react/es6/projects/empty/files/__tests__/Sum.spec.js +0 -6
  106. package/templates/react/es6/projects/empty/files/build.js +0 -25
  107. package/templates/react/es6/projects/empty/files/client/_variables.scss +0 -7
  108. package/templates/react/es6/projects/empty/files/client/components/Header/header.scss +0 -21
  109. package/templates/react/es6/projects/empty/files/client/components/Header/index.js +0 -21
  110. package/templates/react/es6/projects/empty/files/client/components/Toolbar/index.js +0 -20
  111. package/templates/react/es6/projects/empty/files/client/components/Toolbar/toolbar.scss +0 -49
  112. package/templates/react/es6/projects/empty/files/client/containers/App/index.js +0 -16
  113. package/templates/react/es6/projects/empty/files/client/containers/App/style.scss +0 -4
  114. package/templates/react/es6/projects/empty/files/client/general.scss +0 -24
  115. package/templates/react/es6/projects/empty/files/client/index.ejs +0 -13
  116. package/templates/react/es6/projects/empty/files/client/index.js +0 -20
  117. package/templates/react/es6/projects/empty/files/client/lines-bottom-right.svg +0 -56
  118. package/templates/react/es6/projects/empty/files/client/pages/Home/index.js +0 -9
  119. package/templates/react/es6/projects/empty/files/client/pages/routes.js +0 -49
  120. package/templates/react/es6/projects/empty/files/client/pages/routesTemplate.js +0 -9
  121. package/templates/react/es6/projects/empty/files/webpack.config.js +0 -163
  122. package/templates/react/es6/radial-chart/radial-chart/files/client/components/__path__/index.js +0 -71
  123. package/templates/react/es6/radial-chart/radial-chart/files/client/pages/__path__/index.js +0 -10
  124. package/templates/react/es6/scatter-chart/scatter-chart/files/client/components/__path__/index.js +0 -63
  125. package/templates/react/es6/scatter-chart/scatter-chart/files/client/data/temperature.js +0 -58
  126. package/templates/react/es6/scatter-chart/scatter-chart/files/client/pages/__path__/index.js +0 -10
  127. package/templates/react/es6/tree-grid/tree-grid/files/client/components/__path__/index.js +0 -64
  128. package/templates/react/es6/tree-grid/tree-grid/files/client/pages/__path__/index.js +0 -10
  129. package/templates/react/es6/tree-grid/tree-grid-custom/files/client/components/__path__/index.js +0 -65
  130. package/templates/react/es6/tree-grid/tree-grid-custom/files/client/pages/__path__/index.js +0 -10
  131. package/templates/react/es6/tree-grid/tree-grid-editing/files/client/components/__path__/index.js +0 -65
  132. package/templates/react/es6/tree-grid/tree-grid-editing/files/client/pages/__path__/index.js +0 -10
  133. package/templates/react/es6/tree-grid/tree-grid-export/files/client/pages/__path__/index.js +0 -10
@@ -0,0 +1,124 @@
1
+ import { Component } from 'react';
2
+ import * as $ from 'jquery';
3
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_core.js";
4
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_collections.js";
5
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_text.js";
6
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_io.js";
7
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_ui.js";
8
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.documents.core_core.js";
9
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_collectionsextended.js";
10
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.excel_core.js";
11
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_threading.js";
12
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.ext_web.js";
13
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.xml.js";
14
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.documents.core_openxml.js";
15
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.excel_serialization_openxml.js";
16
+ import "@infragistics/ignite-ui-full/en/js/modules/infragistics.gridexcelexporter.js";
17
+ import "file-saver";
18
+ import $(Control) from "igniteui-react/ui/$(widget).js";
19
+ import IgCombo from "igniteui-react/ui/igCombo.js";
20
+ import IgButton from "igniteui-react/ui/igButton.js";
21
+ import "./styles.css";
22
+
23
+ export default class $(ClassName) extends Component {
24
+ constructor(props) {
25
+ super(props);
26
+ this.state = {
27
+ options: {
28
+ summaries: false
29
+ },
30
+ employees : [
31
+ { "EmployeeID": "56250fa57ab1535722e564a6", "FirstName": "Downs", "LastName": "Holcomb", "Country": "Italy", "Age": 35, "RegistererDate": "07/25/2015", "IsActive": false },
32
+ { "EmployeeID": "56250fa5c0fd04f12555d44d", "FirstName": "Mckenzie", "LastName": "Calderon", "Country": "USA", "Age": 26, "RegistererDate": "09/22/2014", "IsActive": false },
33
+ { "EmployeeID": "56250fa565a7bcc21f6bd15e", "FirstName": "Howell", "LastName": "Hawkins", "Country": "Canada", "Age": 25, "RegistererDate": "08/08/2015", "IsActive": false },
34
+ { "EmployeeID": "56250fa5d71a83c33f3f6479", "FirstName": "Sheppard", "LastName": "Nicholson", "Country": "Italy", "Age": 49, "RegistererDate": "06/28/2014", "IsActive": false },
35
+ { "EmployeeID": "56250fa546abbe8c616d37eb", "FirstName": "Bettye", "LastName": "Trujillo", "Country": "Canada", "Age": 37, "RegistererDate": "04/19/2015", "IsActive": false },
36
+ { "EmployeeID": "56250fa535809820f2c44291", "FirstName": "Joyce", "LastName": "Vaughan", "Country": "USA", "Age": 48, "RegistererDate": "04/24/2014", "IsActive": false },
37
+ { "EmployeeID": "56250fa5732f6adc0b52ace0", "FirstName": "Janine", "LastName": "Munoz", "Country": "USA", "Age": 59, "RegistererDate": "02/09/2014", "IsActive": true },
38
+ { "EmployeeID": "56250fa540b15dfd507cffb9", "FirstName": "Betsy", "LastName": "Short", "Country": "USA", "Age": 26, "RegistererDate": "06/04/2015", "IsActive": false },
39
+ { "EmployeeID": "56250fa5a33146a85fdeda66", "FirstName": "Tanisha", "LastName": "Harrington", "Country": "USA", "Age": 31, "RegistererDate": "11/25/2014", "IsActive": false },
40
+ { "EmployeeID": "56250fa572bea435113bb3be", "FirstName": "French", "LastName": "Sullivan", "Country": "Italy", "Age": 37, "RegistererDate": "08/16/2015", "IsActive": true },
41
+ { "EmployeeID": "56250fa55f17965b7b19e3cf", "FirstName": "Gomez", "LastName": "Sandoval", "Country": "Italy", "Age": 24, "RegistererDate": "06/19/2014", "IsActive": true },
42
+ { "EmployeeID": "56250fa5f630e559e163de06", "FirstName": "Estes", "LastName": "Soto", "Country": "Canada", "Age": 24, "RegistererDate": "03/28/2015", "IsActive": false }
43
+ ],
44
+ keys:["EmployeeID", "LastName", "Country", "Age", "IsActive", "Company", "RegistererDate"],
45
+ columnsToSkip: []
46
+ };
47
+
48
+ this.export = () => {
49
+ // export
50
+ $.ig.GridExcelExporter.exportGrid($("#grid-export"), {
51
+ fileName: "igGrid",
52
+ worksheetName: 'Sheet1',
53
+ gridStyling: "none",
54
+ columnsToSkip: this.state.columnsToSkip
55
+ });
56
+ }
57
+ this.selectionChanged = (ev, ui) => {
58
+ this.setState({columnsToSkip: ui.items});
59
+ }
60
+ }
61
+
62
+ showOverlay(grid) {
63
+ var $gridContainer = $('#' + grid.attr('id') + '_container');
64
+ var exportingOverlay = $('<div>');
65
+ exportingOverlay.css({
66
+ "width": $gridContainer.outerWidth(),
67
+ "height": $gridContainer.outerHeight()
68
+ }).html('<span class="exporting-text">Exporting...</span>');
69
+ exportingOverlay.addClass("exporting-overlay");
70
+
71
+ $gridContainer.append(exportingOverlay);
72
+ }
73
+
74
+ hideOverlay(exportingOverlay) {
75
+ exportingOverlay.remove();
76
+ }
77
+
78
+ render() {
79
+ return (
80
+ <div className="App">
81
+ <div className="App-header">
82
+ <h2 style={{textAlign: "center"}}>$(description)</h2>
83
+ </div>
84
+ <div style={{textAlign: "center"}}>
85
+ <IgCombo
86
+ id="combo"
87
+ width="200px"
88
+ mode="dropdown"
89
+ dataSource={this.state.keys}
90
+ multiSelection={{
91
+ enabled: true,
92
+ showCheckboxes: true
93
+ }}
94
+ selectionChanged={this.selectionChanged}
95
+ />
96
+
97
+ <IgButton
98
+ click={this.export}
99
+ onClick={this.export}
100
+ labelText="Export"
101
+ />
102
+ </div>
103
+ <$(Control)
104
+ id="grid-export"
105
+ autoGenerateColumns={false}
106
+ primaryKey="EmployeeID"
107
+ width="100%"
108
+ autofitLastColumn={true}
109
+ columns={[
110
+ { headerText: "Employee ID", key: "EmployeeID", dataType: "string", hidden: true },
111
+ { headerText: "Last Name", key: "LastName", width: "15%", dataType: "string" },
112
+ { headerText: "Country", key: "Country", width: "15%", dataType: "string" },
113
+ { headerText: "Age", key: "Age", width: "15%", dataType: "number" },
114
+ { headerText: "Is Active", key: "IsActive", width: "15%", dataType: "bool", format: "checkbox" },
115
+ { headerText: "Company", key: "Company", width: "20%", dataType: "string", unbound: true, formula: function () { return "http://infragistics.com/"; } },
116
+ { headerText: "Register Date", key: "RegistererDate", width: "20%", dataType: "date" }
117
+ ]}
118
+ dataSource={this.state.employees}
119
+ features={$(gridfeatures)}
120
+ />
121
+ </div>
122
+ );
123
+ }
124
+ }
@@ -15,10 +15,11 @@ class GridExportTemplate extends ReactTemplate_1.ReactTemplate {
15
15
  this.widget = "igGrid";
16
16
  this.controlGroup = "Data Grids";
17
17
  this.dependencies = ["igGrid"];
18
+ this.packages = ["file-saver@^2.0.5"];
18
19
  this.gridHelper = new GridHelper_1.GridHelper();
19
20
  this.hasExtraConfiguration = true;
20
21
  this.extraConfigurations.push({
21
- choices: ["Summaries", "Hiding"],
22
+ choices: ["Paging", "Hiding"],
22
23
  default: "",
23
24
  key: "features",
24
25
  message: "Select features for the igGrid",
@@ -1,9 +1,5 @@
1
- import React, { Component } from 'react';
2
- import 'jquery';
3
- import 'jquery-ui';
4
- $(igniteImports)
1
+ import { Component } from 'react';
5
2
  import $(Control) from "igniteui-react/ui/$(widget).js";
6
-
7
3
  import { northwind } from './northwind.js';
8
4
 
9
5
  export default class $(ClassName) extends Component {
@@ -1,9 +1,5 @@
1
- import React, { Component } from 'react';
2
- import 'jquery';
3
- import 'jquery-ui';
4
- $(igniteImports)
1
+ import { Component } from 'react';
5
2
  import $(Control) from "igniteui-react/ui/$(widget).js";
6
-
7
3
  import { northwind } from './northwind.js';
8
4
 
9
5
  export default class $(ClassName) extends Component {
@@ -0,0 +1,82 @@
1
+ import { Component } from 'react';
2
+ import 'jquery-ui/ui/effects/effect-blind';
3
+ import $(Control) from "igniteui-react/ui/$(widget).js";
4
+
5
+ import { northwind } from './northwind.js';
6
+
7
+ export default class $(ClassName) extends Component {
8
+ constructor(props) {
9
+ super(props);
10
+ this.state = northwind;
11
+ }
12
+ render() {
13
+ return (
14
+ <div className="App">
15
+ <div className="App-header">
16
+ <h2 style={{textAlign: "center"}}>$(description)</h2>
17
+ </div>
18
+ <$(Control)
19
+ id="grid"
20
+ ref="grid"
21
+ features={$(gridfeatures)}
22
+ width="100%"
23
+ autoCommit={true}
24
+ dataSource={this.state}
25
+ dataSourceType="json"
26
+ responseDataKey="results"
27
+ autoGenerateColumns={false}
28
+ autofitLastColumn={false}
29
+ primaryKey="EmployeeID"
30
+ columns={[
31
+ { key: "EmployeeID", headerText: "Employee ID", dataType: "number", width: "0%", hidden: true },
32
+ { key: "LastName", headerText: "Last Name", dataType: "string", width: "20%" },
33
+ { key: "FirstName", headerText: "First Name", dataType: "string", width: "20%" },
34
+ { key: "Title", headerText: "Title", dataType: "string", width: "20%" },
35
+ { key: "City", headerText: "City", dataType: "string", width: "15%" },
36
+ { key: "Region", headerText: "Region", dataType: "string", width: "10%" },
37
+ { key: "Country", headerText: "Country", dataType: "string", width: "0%", hidden: true }
38
+ ]}
39
+ autoGenerateLayouts={false}
40
+
41
+ columnLayouts={[
42
+ {
43
+ key: "Orders",
44
+ autoGenerateColumns: false,
45
+ autofitLastColumn: false,
46
+ primaryKey: "OrderID",
47
+ width: "100%",
48
+ columns: [
49
+ { key: "OrderID", headerText: "Order ID", dataType: "number", width: "0%", hidden: true },
50
+ { key: "CustomerID", headerText: "Customer ID", dataType: "string", width: "15%" },
51
+ { key: "Freight", headerText: "Freight", dataType: "number", format:"0.00", width: "15%" },
52
+ { key: "FreightExpence", headerText: "Freight Expense", unbound: true, dataType: "number", format: "0.00", width: "20%", formula: "CalculateFreightExpence" },
53
+ { key: "ShipName", headerText: "Ship Name", dataType: "string", width: "25%" },
54
+ { key: "ShipCity", headerText: "Ship City", dataType: "string", width: "15%" },
55
+ ],
56
+ features: [
57
+ {
58
+ name: "Responsive",
59
+ enableVerticalRendering: false,
60
+ columnSettings: [
61
+ {
62
+ columnKey: "Freight",
63
+ classes: "ui-hidden-phone"
64
+ },
65
+ {
66
+ columnKey: "CustomerID",
67
+ classes: "ui-hidden-phone"
68
+ },
69
+ {
70
+ columnKey: "ShipName",
71
+ classes: "ui-hidden-phone"
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }
77
+ ]}
78
+ />
79
+ </div>
80
+ );
81
+ }
82
+ }
@@ -0,0 +1,81 @@
1
+ import { Component } from 'react';
2
+ import 'jquery-ui/ui/effects/effect-blind';
3
+ import $(Control) from "igniteui-react/ui/$(widget).js";
4
+ import { northwind } from './northwind.js';
5
+
6
+ export default class $(ClassName) extends Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.state = northwind;
10
+ }
11
+ render() {
12
+ return (
13
+ <div className="App">
14
+ <div className="App-header">
15
+ <h2 style={{textAlign: "center"}}>$(description)</h2>
16
+ </div>
17
+ <$(Control)
18
+ id="grid"
19
+ ref="grid"
20
+ features={$(gridfeatures)}
21
+ width="100%"
22
+ autoCommit={true}
23
+ dataSource={this.state}
24
+ dataSourceType="json"
25
+ responseDataKey="results"
26
+ autoGenerateColumns={false}
27
+ autofitLastColumn={false}
28
+ primaryKey="EmployeeID"
29
+ columns={[
30
+ { key: "EmployeeID", headerText: "Employee ID", dataType: "number", width: "0%", hidden: true },
31
+ { key: "LastName", headerText: "Last Name", dataType: "string", width: "20%" },
32
+ { key: "FirstName", headerText: "First Name", dataType: "string", width: "20%" },
33
+ { key: "Title", headerText: "Title", dataType: "string", width: "20%" },
34
+ { key: "City", headerText: "City", dataType: "string", width: "15%" },
35
+ { key: "Region", headerText: "Region", dataType: "string", width: "10%" },
36
+ { key: "Country", headerText: "Country", dataType: "string", width: "0%", hidden: true }
37
+ ]}
38
+ autoGenerateLayouts={false}
39
+
40
+ columnLayouts={[
41
+ {
42
+ key: "Orders",
43
+ autoGenerateColumns: false,
44
+ autofitLastColumn: false,
45
+ primaryKey: "OrderID",
46
+ width: "100%",
47
+ columns: [
48
+ { key: "OrderID", headerText: "Order ID", dataType: "number", width: "0%", hidden: true },
49
+ { key: "CustomerID", headerText: "Customer ID", dataType: "string", width: "15%" },
50
+ { key: "Freight", headerText: "Freight", dataType: "number", format:"0.00", width: "15%" },
51
+ { key: "FreightExpence", headerText: "Freight Expense", unbound: true, dataType: "number", format: "0.00", width: "20%", formula: "CalculateFreightExpence" },
52
+ { key: "ShipName", headerText: "Ship Name", dataType: "string", width: "25%" },
53
+ { key: "ShipCity", headerText: "Ship City", dataType: "string", width: "15%" },
54
+ ],
55
+ features: [
56
+ {
57
+ name: "Responsive",
58
+ enableVerticalRendering: false,
59
+ columnSettings: [
60
+ {
61
+ columnKey: "Freight",
62
+ classes: "ui-hidden-phone"
63
+ },
64
+ {
65
+ columnKey: "CustomerID",
66
+ classes: "ui-hidden-phone"
67
+ },
68
+ {
69
+ columnKey: "ShipName",
70
+ classes: "ui-hidden-phone"
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ ]}
77
+ />
78
+ </div>
79
+ );
80
+ }
81
+ }