Advertisement
lavinnagi

Untitled

Feb 22nd, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.03 KB | None | 0 0
  1. {% extends "default/base.html" %}
  2. <title>{% block title %} Grid data {% endblock %}</title>
  3. {% block content %}
  4. <script type="text/javascript">
  5.  
  6.  
  7. $(document).ready(function(){
  8. var data = {{evtx_data|safe}};
  9.  
  10. var source =
  11. {
  12. localdata: data,
  13. datatype: "json",
  14. datafields:
  15. [
  16. { name: 'evidence', map: 'fields>evidence', type: 'string' },
  17. { name: 'created_timestamp', map: 'fields>created_timestamp', type: 'date' },
  18. { name: 'timestamp_desc', map: 'fields>timestamp_desc', type: 'string' },
  19. { name: 'filename', map: 'fields>filename', type: 'string' },
  20. { name: 'file_path', map: 'fields>file_path', type: 'string' },
  21. { name: 'record_number', map: 'fields>record_number', type: 'stirng' },
  22. { name: 'orig_filename_lagacy', map: 'fields>orig_filename_lagacy', type: 'string' },
  23. { name: 'computer_name', map: 'fields>computer_name', type: 'string' },
  24. { name: 'user_sid', map: 'fields>user_sid', type: 'string' },
  25.  
  26. { name: 'event_identifier', map: 'fields>event_identifier', type: 'string' },
  27. { name: 'event_level', map: 'fields>event_level', type: 'string' },
  28. { name: 'event_category', map: 'fields>event_category', type: 'string' },
  29. { name: 'event_name', map: 'fields>event_name', type: 'string' },
  30. { name: 'strings', map: 'fields>strings', type: 'string' },
  31. { name: 'xml_string', map: 'fields>xml_string', type: 'string' },
  32. { name: 'vss', map: 'fields>vss', type: 'string' },
  33.  
  34. ],
  35. };
  36. var dataAdapter = new $.jqx.dataAdapter(source);
  37. // initialize jqxGrid
  38. $("#jqxgrid").jqxGrid(
  39. {
  40. width: '100%',
  41. height:450,
  42. source: dataAdapter,
  43. altrows: true,
  44. sortable: true,
  45. virtualmode: true,
  46. pageable: true,
  47.  
  48. groupable: true,
  49. columnsresize: true,
  50. selectionmode: 'multiplecellsextended',
  51. columns:
  52. [
  53. { text: 'Evidence', columntype: 'textbox', datafield: 'evidence', width: 130 },
  54. { text: 'Created', columntype: 'textbox', datafield: 'created_timestamp', width: 90 },
  55. { text: 'Timestamp Description', columntype: 'textbox', datafield: 'timestamp_desc', width: 60 },
  56. { text: 'File Name', columntype: 'textbox', datafield: 'filename', width: 130},
  57.  
  58. { text: 'File Path ', columntype: 'textbox', datafield: 'file_path', width: 100 },
  59.  
  60. { text: 'Record Number', columntype: 'textbox', datafield: 'record_number', width: 60 },
  61. { text: 'computer Name', columntype: 'textbox', datafield: 'computer_name', width: 60 },
  62. { text: 'User Sid ', columntype: 'textbox', datafield: 'user_sid', width: 70 },
  63.  
  64. { text: 'Event Identifier', columntype: 'textbox', datafield: 'event_identifier', width: 70 },
  65. { text: 'Event Level', columntype: 'textbox', datafield: 'event_level', width: 70 },
  66. { text: 'Event Category', columntype: 'textbox', datafield: 'event_category', width: 70 },
  67. { text: 'Event Name', columntype: 'textbox', datafield: 'event_name', width: 70 },
  68. { text: 'Strings', columntype: 'textbox', datafield: 'strings', width: 70 },
  69. { text: 'Xml String', datafield: 'xml_string', cellsalign: 'right', cellsformat: 'n2' }
  70. ]
  71. });
  72. $("#excelExport").jqxButton({ theme: theme });
  73. $("#xmlExport").jqxButton({ theme: theme });
  74. $("#csvExport").jqxButton({ theme: theme });
  75. $("#tsvExport").jqxButton({ theme: theme });
  76. $("#htmlExport").jqxButton({ theme: theme });
  77. $("#jsonExport").jqxButton({ theme: theme });
  78. $("#excelExport").click(function () {
  79. $("#jqxgrid").jqxGrid('exportdata', 'xls', 'jqxGrid');
  80. });
  81. $("#xmlExport").click(function () {
  82. $("#jqxgrid").jqxGrid('exportdata', 'xml', 'jqxGrid');
  83. });
  84. $("#csvExport").click(function () {
  85. $("#jqxgrid").jqxGrid('exportdata', 'csv', 'jqxGrid');
  86. });
  87. $("#tsvExport").click(function () {
  88. $("#jqxgrid").jqxGrid('exportdata', 'tsv', 'jqxGrid');
  89. });
  90. $("#htmlExport").click(function () {
  91. $("#jqxgrid").jqxGrid('exportdata', 'html', 'jqxGrid');
  92. });
  93. $("#jsonExport").click(function () {
  94. $("#jqxgrid").jqxGrid('exportdata', 'json', 'jqxGrid');
  95. });
  96. });
  97.  
  98. </script>
  99.  
  100. </head>
  101.  
  102. <body>
  103. <body class='default'>
  104. <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float:left;margin-left: 5px;">
  105. <div id='jqxgrid' style=width:100%></div>
  106. <div style='margin-top: 20px;'>
  107. <div style='float: left;'>
  108. <input type="button" value="Export to Excel" id='excelExport' />
  109.  
  110. <input type="button" value="Export to XML" id='xmlExport' />
  111. </div>
  112. <div style='margin-left: 10px; float: left;'>
  113. <input type="button" value="Export to CSV" id='csvExport' />
  114.  
  115. <input type="button" value="Export to TSV" id='tsvExport' />
  116. </div>
  117. <div style='margin-left: 10px; float: left;'>
  118. <input type="button" value="Export to HTML" id='htmlExport' />
  119.  
  120. <input type="button" value="Export to JSON" id='jsonExport' />
  121. </div>
  122. </div>
  123. </div>
  124.  
  125.  
  126. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement