Guest User

Untitled

a guest
May 24th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(document).ready(function() {
  4. $('#btnSubmit').click(function() {
  5.  
  6. /* Refreshes the grid */
  7. $("#list").jqGrid({
  8. /* The controller action to get the grid data from */
  9. url: '/CRA/AddPart',
  10. data: { partNumber: "123"},
  11. datatype: 'json',
  12. mtype: 'GET',
  13. /* Define the headers on the grid */
  14. colNames: ['col1', 'col2', 'col3', 'col4'],
  15. /* Define what fields the row columns come from */
  16. colModel: [
  17. { name: 'col1', index: 'invid', width: 290 },
  18. { name: 'col2', index: 'invdate', width: 290 },
  19. { name: 'col3', index: 'amount', width: 290, align: 'right' },
  20. { name: 'col4', index: 'tax', width: 290, align: 'right'}],
  21. height: 'auto',
  22. rowNum: 10,
  23. rowList: [10, 20, 30],
  24. sortname: 'id',
  25. sortorder: "desc",
  26. viewrecords: true,
  27. imgpath: '../../Scripts/jgrid/themes/steel/images',
  28. caption: 'Core Return Authorization Contents:',
  29. cellEdit: true
  30. });
  31. });
  32. });
  33.  
  34. </script>
  35.  
  36. <script type="text/javascript">
  37. var firstClick = true;
  38. $(document).ready(function() {
  39. $('#btnSubmit').click(function() {
  40. if (!firstClick) {
  41. $("#list").trigger("reloadGrid");
  42. }
  43. firstClick = false;
  44. /* Refreshes the grid */
  45. $("#list").jqGrid({
  46. /* The controller action to get the grid data from */
  47. url: '/CRA/AddPart',
  48. data: { partNumber: "123"},
  49. datatype: 'json',
  50. mtype: 'GET',
  51. /* Define the headers on the grid */
  52. colNames: ['col1', 'col2', 'col3', 'col4'],
  53. /* Define what fields the row columns come from */
  54. colModel: [
  55. { name: 'col1', index: 'invid', width: 290 },
  56. { name: 'col2', index: 'invdate', width: 290 },
  57. { name: 'col3', index: 'amount', width: 290, align: 'right' },
  58. { name: 'col4', index: 'tax', width: 290, align: 'right'}],
  59. height: 'auto',
  60. rowNum: 10,
  61. rowList: [10, 20, 30],
  62. sortname: 'id',
  63. sortorder: "desc",
  64. viewrecords: true,
  65. imgpath: '../../Scripts/jgrid/themes/steel/images',
  66. caption: 'Core Return Authorization Contents:',
  67. cellEdit: true
  68. });
  69. });
  70. });
  71.  
  72. </script>
Add Comment
Please, Sign In to add comment