Demonstration
Introduces the basic use of ax5ui-grid UI.

Inline edit

Paste the following code into the head section of your site’s HTML.

  1. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-calendar/master/dist/ax5calendar.css">
  2. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-picker/master/dist/ax5picker.css">
  3. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-select/master/dist/ax5select.css">
  4. <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-grid/master/dist/ax5grid.css">
  5. <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
  6. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5core/master/dist/ax5core.min.js"></script>
  7. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-calendar/master/dist/ax5calendar.min.js"></script>
  8. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-picker/master/dist/ax5picker.min.js"></script>
  9. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-formatter/master/dist/ax5formatter.min.js"></script>
  10. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-select/master/dist/ax5select.min.js"></script>
  11. <script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-grid/master/dist/ax5grid.min.js"></script>
HTML
  1. <div style="position: relative;height:400px;" id="grid-parent">
  2. <div data-ax5grid="first-grid" data-ax5grid-config="{
  3. showLineNumber: true,
  4. showRowSelector: true,
  5. sortable: true,
  6. header: {align:"center"}
  7. }" style="height: 100%;"></div>
  8. </div>
 
field Afield Bfield CsaleDtcustomeruserTypedesc
priceamountcost
  
SUMMARY1,222.22154178,500    
-14 - -3 of 21
JS
  1. <script type="text/javascript">
  2. $(document.body).ready(function () {
  3. var API_SERVER = "http://api-demo.ax5.io";
  4. var firstGrid = new ax5.ui.grid({
  5. target: $('[data-ax5grid="first-grid"]'),
  6. columns: [
  7. {
  8. key: "a",
  9. label: "field A",
  10. width: 80,
  11. styleClass: function () {
  12. return "ABC";
  13. },
  14. enableFilter: true,
  15. align: "center", editor: {type: "text"}
  16. },
  17. {key: "b", label: "field B", align: "center", editor: {type: "text"}},
  18. {
  19. key: undefined, label: "field C", columns: [
  20. {key: "price", label: "price", formatter: "money", align: "right", editor: {type: "money", updateWith:['cost']}},
  21. {key: "amount", label: "amount", formatter: "money", align: "right", editor: {type: "money", updateWith:['cost']}},
  22. {
  23. key: "cost", label: "cost", align: "right", formatter: function () {
  24. return ax5.util.number(this.item.price * this.item.amount, {"money": true});
  25. }
  26. }
  27. ]
  28. },
  29. {
  30. key: "saleDt", label: "saleDt", align: "center", editor: {
  31. type: "date",
  32. config: {
  33. content: {
  34. config: {
  35. mode: "year", selectMode: "day"
  36. }
  37. }
  38. }
  39. }
  40. },
  41. {key: "customer", label: "customer", editor: {type: "text"}},
  42. {
  43. key: "userType", label: "userType", editor: {
  44. type: "select", config: {
  45. columnKeys: {
  46. optionValue: "CD", optionText: "NM"
  47. },
  48. options: [
  49. {CD: "M", NM: "M: Man"},
  50. {CD: "D", NM: "D: Daughter"},
  51. {CD: "S", NM: "S: Son"},
  52. {CD: "W", NM: "W: Wife"}
  53. ]
  54. }
  55. }
  56. },
  57. {key: "desc", label: "desc", width:200, editor: {type: "textarea"}}
  58. ],
  59. body: {
  60. grouping: {
  61. by: ["a"],
  62. columns: [
  63. {
  64. label: function () {
  65. return this.groupBy.labels.join(", ") + " SUM";
  66. }, colspan: 2, align: "center"
  67. },
  68. {key: "price", collector: "avg", formatter: "money", align: "right"},
  69. {key: "amount", collector: "sum", formatter: "money", align: "right"},
  70. {
  71. key: "cost", collector: function () {
  72. var value = 0;
  73. this.list.forEach(function (n) {
  74. if (!n.__isGrouping) value += (n.price * n.amount);
  75. });
  76. return ax5.util.number(value, {"money": 1});
  77. }, align: "right"
  78. }
  79. ]
  80. }
  81. },
  82. footSum: [
  83. [
  84. {label: "SUMMARY", colspan: 2, align: "center"},
  85. {key: "price", collector: "avg", formatter: "money", align: "right"},
  86. {key: "amount", collector: "sum", formatter: "money", align: "right"},
  87. {
  88. key: "cost", collector: function () {
  89. var value = 0;
  90. this.list.forEach(function (n) {
  91. if (!n.__isGrouping) value += (n.price * n.amount);
  92. });
  93. return ax5.util.number(value, {"money": 1});
  94. }, align: "right"
  95. }
  96. ]]
  97. });
  98. firstGrid.setData(gridList);
  99. // 그리드 데이터 가져오기
  100. /*
  101. $.ajax({
  102. method: "GET",
  103. url: API_SERVER + "/api/v1/ax5grid/order",
  104. success: function (res) {
  105. firstGrid.setData(res);
  106. }
  107. });
  108. */
  109. });
  110. </script>

AX5UI Package

'AX5UI' can be used with Bootstrap theme. The development of the distribution of the various UI plug-in. When you click the link to move to AX5UI index page.

Get AXBoot

AXBoot makes it easy to build web applications with Java & HTML5 Repeatable and noise development process are resolved by AXBoot.

Code licensed
MIT
Mantained by
Thomas Jang, Brant and Team AXISJ
Templete design by
Jorwrney Kim
Copyright
Opensource Group AXISJ - www.axisj.com
DNS
DNSEver