Advertisement
Guest User

dashboardUsuario.js

a guest
Nov 20th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. function iniciarEventos() {
  2. var Error = "";
  3. $('.datetimepicker').datetimepicker({
  4. format: 'YYYY-MM-DD',
  5. defaultDate: new Date()
  6.  
  7. });
  8. var pJData = [];
  9. pJData.push({
  10. usuarioId: usuarioId,
  11. fechaInicio: "2018-09-01",
  12. fechaFin: $("#filtroFechaInicio").val(),
  13. });
  14.  
  15. pJData = JSON.stringify(pJData);
  16. $.ajax({
  17. type: "POST",
  18. url: "usuarioDashboard.aspx/CargarTablas",
  19. data: JSON.stringify({ pJData: pJData }),
  20. dataType: "json",
  21. async: false,
  22. cache: false,
  23. contentType: "application/json; charset=utf-8",
  24. success: function (datos) {
  25. var existeError = datos.d.indexOf('Error');
  26. if (existeError == -1) {
  27. datosDashboard = JSON.parse(datos.d);
  28. console.log(datosDashboard);
  29. } else {
  30. Error = datos.d;
  31. if (Error != "") {
  32. alert(Error);
  33. return false;
  34. }
  35. }
  36. },
  37. error: function (datos) {
  38. Error = datos.d;
  39. alert(Error);
  40. }
  41. });
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement