Advertisement
krot

ui combobox selected

Feb 27th, 2018
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.10 KB | None | 0 0
  1. // Destroy the combobox
  2. $(".combobox").combobox("destroy");
  3.  
  4. // Unselect the currently selected option
  5. $("#selectlist option:selected").removeAttr("selected");
  6.  
  7. // Select the option you want to select
  8. $("#selectlist option[value='test']").attr("selected", "selected");
  9.  
  10. // Create the combobox again
  11. $(".combobox").combobox();
  12.  
  13. $('#scale').val('square');
  14. $("#scale").selectmenu("refresh");
  15.  
  16.       function combobox_select(el,val){
  17.             $(el).combobox("destroy");
  18.             $(el+' option:selected').removeAttr("selected");
  19.             $(el+' option[value="'+val+'"]').attr("selected", "selected");
  20.             $(el).combobox();
  21.            
  22.   }
  23. //
  24.                     $('#dvid option:selected').removeAttr("selected");
  25.                     $("#dvid option[value='"+dvid+"']").attr("selected", "selected");
  26.                     $("#dvid").selectmenu("refresh");
  27.  
  28.  
  29.  
  30.  $('#combobox option:selected').removeAttr("selected");
  31.             $('#combobox  option[value="'+prepId+'"]').attr("selected", "selected");
  32.            $('#combobox').parent().find(".custom-combobox-input").val($("#combobox option[selected]").text());
  33.              
  34.              
  35.              $('#role option:selected').removeAttr("selected");
  36.             $('#role  option[value="'+roleId+'"]').attr("selected", "selected");
  37.            $('#role').parent().find(".ui-selectmenu-text").text($("#role option[selected]").text());
  38.  
  39.  
  40.  $('#combobox option:selected').removeAttr("selected");
  41.             $('#combobox  option[value="'+v+'"]').attr("selected", "selected");
  42.            $('#combobox').parent().find(".custom-combobox-input").val($("#combobox option[selected]").text());
  43.              
  44.              
  45.              $('#role option:selected').removeAttr("selected");
  46.             $('#role  option[value="'+v+'"]').attr("selected", "selected");
  47.            $('#role').parent().find(".ui-selectmenu-text").text($("#role option[selected]").text());
  48.  
  49.     $('#combobox option[selected]').removeAttr("selected");
  50.             $('#combobox  option[value="'+prepId+'"]').prop({defaultSelected: true});
  51.  
  52.  $('#n-job option:selected').removeAttr("selected");
  53.             $('#n-job  option[value="'+$(this).data('job')+'"]').prop({defaultSelected: true});
  54.              $("#n-job").selectmenu("refresh");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement