Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. var dropdownlist = $("#ddlLocation").data("kendoDropDownList");
  2. dropdownlist.select(function (dataItem) {
  3. return dataItem.symbol === "[Please Select Location]";
  4. });
  5.  
  6. var userId = $("#hiddenUser").val();
  7. $("#PositionInputs").kendoDropDownList({
  8. dataTextField: "Name",
  9. dataValueField: "ID",
  10. index: 0,
  11. autoBind: false,
  12. change: function () {
  13. var value = this.value();
  14. var dataItem1 = this.dataItem(this.select());
  15. if (value) {
  16. var dropdownlist = $("#ddlLocation").data("kendoDropDownList");
  17. dropdownlist.select(function (dataItem) {
  18. return dataItem.symbol === "[Please Select Location]";
  19. });
  20.  
  21. }
  22. },
  23. optionLabel: "[Please Select Position]",
  24. template: '<h5>${ data.Name }</h5>',
  25. dataSource: {
  26. transport: {
  27. read: {
  28. url: '/Profile/LoadDropdownList?userId=' + userId,
  29. dataType: "json",
  30. type: "POST"
  31.  
  32. }
  33. }
  34. }
  35.  
  36. });
  37.  
  38.  
  39. //kendo dropdown
  40. $("#ddlPosition").kendoDropDownList({
  41. dataTextField: "Name",
  42. dataValueField: "ID",
  43. autoBind: false,
  44. optionLabel: {
  45. Name: "[Please Select Position]",
  46. ID: "0"
  47. },
  48. // define custom template
  49. template:
  50. '<h5>${ data.Name }</h5>',
  51. dataSource: {
  52. transport: {
  53. read: {
  54. url: '/Profile/LoadDropdownList?userId=' + userId,
  55. dataType: "json",
  56. type: "POST"
  57. }
  58. }
  59. }
  60. });
  61.  
  62.  
  63.  
  64. //kendo dropdown
  65. $("#ddlLocation").kendoDropDownList({
  66. dataTextField: "Address",
  67. dataValueField: "Id",
  68. autoBind: false,
  69. optionLabel: "[Please Select Position]",
  70. // define custom template
  71. template: '<h5>${ data.Address }</h5>',
  72. dataSource: {
  73. transport: {
  74. read: {
  75. url: '/Profile/LoadLocationDropdownList?userId=' + userId,
  76. dataType: "json",
  77. type: "POST"
  78. }
  79. }
  80. }
  81.  
  82. });
  83.  
  84.  
  85.  
  86.  
  87. $("#LocationInputs").kendoDropDownList({
  88. dataTextField: "Address",
  89. dataValueField: "Id",
  90. // index: 0,
  91. autoBind: false,
  92. cascadeFrom: "PositionInputs",
  93. optionLabel: {
  94. Address: "[Please Select Position]",
  95. Id: "0"
  96. },
  97. template: '<h5>${ data.Address }</h5>',
  98. dataSource: {
  99. transport: {
  100. read: {
  101. url: '/Profile/LoadLocationDropdownList?userId=' + userId,
  102. dataType: "json",
  103. type: "POST"
  104. }
  105. }
  106. }
  107. });
  108.  
  109. var ddl = $("#someId").data("kendoDropDownList");
  110. ddl.select(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement