Guest User

Untitled

a guest
Aug 15th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. @(Html.Kendo().Button()
  2. .Name("btnSubmit")
  3. .HtmlAttributes(new { type = "button", title= "Report1", url = "/Controller1/Method1/" })
  4. .Icon("k-icon k-i-file-txt")
  5. .Content("View Details")
  6. .Events(e => e.Click("ShowDetails"))
  7.  
  8. )
  9.  
  10. function ShowDetails() {
  11. var URL = this.element.attr("url")
  12. $('#win_wnd_title').text(this.element.attr("title"));
  13. $.ajax(
  14. {
  15. url: URL,
  16. type: 'post',
  17. dataType: "html",
  18. data: ?
  19. contentType: 'application/json; charset=utf-8',
  20. success: function (result) {
  21. var dialog = $("#win").data("kendoWindow");
  22. $("#dataWin").html(result);
  23. dialog.open();
  24. showLoaderPopup();
  25. }
  26. })
  27. }
  28.  
  29. If (flag == 1)
  30. {
  31. var myData = JSON.stringify({ ID: id, Amount: amount, Desc: desc });
  32. }
  33. else
  34. {
  35. var myData = null
  36. }
  37.  
  38. $.ajax(
  39. {
  40. .
  41. .
  42. .
  43. data: myData
  44. }
  45. )
  46.  
  47. Button()
  48. .Name("btnSubmit")
  49. .HtmlAttributes(new { type = "button", title= "Report1", url = "/Controller1/Method1/", sendData = "true" })
  50. .Icon("k-icon k-i-file-txt")
  51. .Content("View Details")
  52. .Events(e => e.Click("ShowDetails"))
  53. )
  54.  
  55. function ShowDetails() {
  56. var URL = $(sender).data('url');
  57. var myData = null;
  58.  
  59. if($(sender).data('sendData') == "true")
  60. {
  61. myData = JSON.stringify({ ID: id, Amount: amount, Desc: desc });
  62. }
  63.  
  64. $.ajax(
  65. {
  66. ...
  67.  
  68. data: myData
  69. success: function (result) {
  70. ...
  71. }
  72. })
Add Comment
Please, Sign In to add comment