Guest User

Untitled

a guest
Dec 12th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. function EditInfo(var, tableId) {
  2. var DropdownLoaded = LoadDropdown(var);
  3. $.when(DropdownLoaded).done(function () {
  4. $('#DropdownCore').selectpicker('val', tableId);
  5. });
  6.  
  7. $('#CoreModal').modal('show');
  8. }
  9.  
  10. function LoadDropdown(mfg) {
  11. var funcDone = false;
  12.  
  13. $.getJSON("FilterCore", { mfg: mfg }, function (data) {
  14. $('#DropdownCore').empty();
  15.  
  16. $.each(data, function () {
  17. $('#DropdownCore').append($('<option></option>').val(this.Value).text(this.Text));
  18. });
  19.  
  20. $('.selectpicker').selectpicker('refresh');
  21.  
  22. $("#MFGDropdownCore option[value='0']").remove();
  23.  
  24. }).done(function () {
  25. funcDone = true;
  26. });
  27.  
  28. $.when(funcDone).then(function () {
  29. return true;
  30. });
  31. }
Add Comment
Please, Sign In to add comment