or
Hello,
I am writing an order-entry app using AngularJS and Kendo UI Grid. I am new to both and am looking for some guidance on how best to approach the scenario below.
The order line grid is populated with Json data from a server (ASP.NET Web API). For example, for order # 3:
[ { "OrderId":3, "Line":1, "ItemId":"0023", "Description":"Alcaline substrat-234", "Class":"A34", "Manufacturer":"AA123", "PartNo":"12347354", "Qty":2, "ExtCost":12.72, "ExtPrice":19.10, "ExtTax":1.80, "Comment":"Some comment... Could be long...", Serials: [ "AAAA1234", "BBBB2222" ] }, { "OrderId":3, "Line":2, "ItemId":"0056", "Description":"Bee pulsating epox", "Class":"34", "Manufacturer":"ZB83", "PartNo":"52234623", "Qty":1, "ExtCost":252.31, "ExtPrice":290.11, "ExtTax":20.10, "Comment":"Some other comment about this line...", Serials: [ "AAAA1234", "BBBB2222" ] }]01.<!DOCTYPE html>02.<html>03.<head>04. <meta charset="utf-8">05. <title>Treeview</title>06. <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css">07. <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css">08. <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>09. <script src="http://cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>10. <style>11. .img-24 {12. height: 24px;13. width: 24px;14. }15. </style>16.</head>17.<body>18.<ul data-role="treeview" data-bind="source:sample" data-template="my-template"></ul>19.<script id="my-template" type="text/x-kendo-template">20. <a href="#: item.hash$ #">21. <img src="#: item.icon$ #" alt="#: item.name #" class="img-24">22. <span>#: item.name #</span>23. </a>24.</script>25. 26.<script>27. /**28. * Rummage model (displayed in treeview on find page)29. * @type {kendo.data.Model}30. */31. var STRING = 'string',32. NUMBER = 'number',33. MyNode = kendo.data.Node.define({34. id: 'id',35. hasChildren: true,36. children: {37. schema: {38. data: 'items',39. model: MyNode40. }41. },42. fields: {43. id: {44. type: NUMBER,45. editable: false46. },47. name: {48. type: STRING,49. editable: false50. },51. icon: {52. type: STRING,53. editable: false54. },55. hash: {56. type: STRING,57. editable: false58. }59. },60. icon$: function() {61. return 'http://localhost/images/' + this.get('icon');62. },63. hash$: function() {64. return 'http://localhost/find#!' + encodeURIComponent(this.get('hash'));65. }66. });67. 68. 69. window.viewModel = kendo.observable({70. sample: new kendo.data.HierarchicalDataSource({71. transport: {72. read: function(options) {73. options.success([74. { id: 1, name: 'node 1', icon: '1.png', hash:'1', items: [75. { id: 4, name: 'node 1.1', icon: '1.1.png', hash:'1.1' },76. { id: 5, name: 'node 1.2', icon: '1.2.png', hash:'1.2' }77. ] },78. { id: 2, name: 'node 2', icon: '2.png', hash:'2' },79. { id: 3, name: 'node 3', icon: '3.png', hash:'3' }80. ]);81. }82. },83. schema: {84. model: MyNode85. }86. })87. });88. 89. $(document).ready(function() {90. kendo.bind('body', window.viewModel);91. });92. 93.</script>94.</body>95.</html><input id="imtSelect" name="IMT" required data-required-msg="IMT is required." data-bind="value: imt">var imtData = [ "US", "Canada", "Federal" ];// create ComboBox for IMT...$("#imtSelect").kendoComboBox({ dataSource : imtData, index : 0});$("#imtSelect").kendoComboBox({ dataSource : imtData, index : 0 placeholder : "Select..."});