Guest User

Untitled

a guest
Jul 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. var oTable = $('.display').dataTable({
  2. "bJQueryUI": true,
  3. "oLanguage": {
  4. "sSearch": "Search all columns:"
  5. },
  6. "sDom": '<"H"lfr<"toolbar">>t<"clear"><"F" ip>',
  7. "bProcessing": true,
  8. "bJQueryUI": true,
  9. "sPaginationType": "full_numbers",
  10. "bServerSide": true,
  11. "sAjaxSource": "/Home/TableData",
  12. "fnServerData": function (sSource, aoData, fnCallback) {
  13. /* Add some extra data to the sender */
  14. aoData.push({ "name": "dateStart", "value": $("#startDateInput").attr('value') });
  15. aoData.push({ "name": "dateEnd", "value": $("#endDateInput").attr('value') });
  16. aoData.push({ "name": "showing", "value": $("#showingSelect").attr('value') });
  17. aoData.push({ "name": "health_sort", "value": $("#search_health").val() });
  18. aoData.push({ "name": "rand", "value": (Math.random() * 11) });
  19. $.getJSON(sSource, aoData, function (json) {
  20. /* Do whatever additional processing you want on the callback, then tell DataTables */
  21. fnCallback(json);
  22.  
  23. //this has been placed here, as a separate fucntion and before fnCallback, all do not work
  24. $(".dataTables_filter input").attr('value', json.search);
  25. });
  26. },
  27. "aoColumns": [
  28. { "mDataProp": "details" },
  29. { "mDataProp": "organization" },
  30. { "mDataProp": "system" },
  31. { "mDataProp": "classification" },
  32. { "mDataProp": "slm" },
  33. { "mDataProp": "lifecycle" },
  34. { "mDataProp": "date_created" },
  35. { "mDataProp": "project_health_html" }
  36. ]
  37. });
Add Comment
Please, Sign In to add comment