Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. var pageSize = 10;
  2. $('#Cliente').select2(
  3. {
  4. minimumInputLength: 0,
  5. allowClear: true,
  6. ajax: {
  7. quietMillis: 150,
  8. url: '@Url.Action("clientes", "Cliente", new { area = "Comercial" })',
  9. dataType: 'json',
  10. data: function (filtro, page) {
  11. return {
  12. pageSize: pageSize,
  13. pageNum: page,
  14. Filtro: filtro
  15. };
  16. },
  17. results: function (data, page) {
  18. var more = (page * pageSize) < data.total;
  19. return {
  20. results: data.result,
  21. more: more
  22. };
  23. }
  24. },
  25. }).change(function (e) {
  26. e.val;
  27. });
  28. });
  29.  
  30. var pageSize = 10;
  31. $('#Grupo').select2(
  32. {
  33. minimumInputLength: 0,
  34. allowClear: true,
  35. ajax: {
  36. quietMillis: 150,
  37. url: '@Url.Action("Grupos", "Cliente", new { area = "Comercial" })',
  38. dataType: 'json',
  39. data: function (filtro, page) {
  40. return {
  41. pageSize: pageSize,
  42. pageNum: page,
  43. Filtro: filtro,
  44. ClienteId: ??
  45. };
  46. },
  47. results: function (data, page) {
  48. var more = (page * pageSize) < data.total;
  49. return {
  50. results: data.result,
  51. more: more
  52. };
  53. }
  54. }
  55. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement