Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. $("#turbingrid").kendoGrid({
  2. // debugger;
  3.  
  4. dataSource: dataSource,
  5. scrollable: false,
  6. columns: [
  7. { field: 'DeviceIP', title: 'DeviceIP', width: '100px', id: 'DeviceIP' },
  8. { field: 'Producer', title: 'Producer', width: '80px', editor: ProductNameDropDownEditor, },
  9. { field: 'Model', title: 'Model', width: '220px' },
  10. { field: 'DeviceType', title: 'DeviceType', width: '100px',editor: deviceTypesList },
  11. { field: 'Description', title: 'Description', width: '220px' },
  12. { field: 'Username', title: 'Username', width: '120px' },
  13. { field: 'Password', title: 'Password', width: '100px' },
  14. { field: 'PublicIP', title: 'PublicIP', width: '120px' },
  15. { field: 'device_id', title: 'device_id', width: '120px', hidden: true },
  16. { field: 'ModelProducer', title: 'ModelProducer', hidden: true, editor: modelProducer },
  17. { command: ["edit"], title: " " }],
  18. editable: "popup",
  19. //edit:
  20. // function () {
  21. // document.getElementsByName("DeviceIP")[0].disabled = true;
  22.  
  23. // },
  24.  
  25. edit: function(e) {
  26. e.container.find("label[for='device_id']").parent().hide();
  27. e.container.find("div[data-container-for='device_id']").hide();
  28. var ss = $("#DeviceType").val();
  29. $.ajax({
  30. dataType: "json",
  31. type: "POST",
  32. url: "@Url.Action("modelProducer","AdminTool")",
  33. contentType: "application/json; charset=utf-8",
  34. data: JSON.stringify({ "turbineType": ss, }),
  35. success: function (data) {
  36. modelProducerResult = data;
  37. debugger;
  38. function modelProducer(container, options) {
  39. $('<input name="ModelProducer" data-type="string"">')
  40. .appendTo(container)
  41. .kendoDropDownList({
  42. valuePrimitive: true,
  43. dataSource: modelProducerResult,
  44. dataTextField: "model",
  45. dataValueField: "model",
  46. });
  47. debugger;
  48. }
  49. }
  50.  
  51. });
  52. }
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement