2014-02-13 31 views
0

我正在使用這個jQuery UI Multiselect Widget腳本:http://runnable.com/UgMdJqspu4chAAAP/how-to-create-jquery-ui-multiselect-widget在asp.net.I有一個子頁面與主頁面。雖然我默認應用此控件,全部申請dropdownlist。我想申請一個Dropdownlist。有人可以幫我嗎?jQuery UI MultiSelect Widget-無法在一個項目中應用

<script type="text/javascript"> 
    $(function() { 
     /* 
     define global variable, 
     and store message container element. 
     */ 
     var warning = $(".message"); 

     $('select').multiselect(
     { 
      /* 
      The name of the effect to use when the menu opens. 
      To control the speed as well, pass in an array 
      */ 
      show: ["slide", 1000], 
      /* 
      The name of the effect to use when the menu closes. 
      To control the speed as well, pass in an array 
      */ 
      hide: ["slide", 1000], 
      /* 
      Either a boolean value denoting whether or not to display the header, 
      or a string value. 
      If you pass a string, 
      the default "check all", "uncheck all", and "close" 
      links will be replaced with the specified text. 
      */ 
      header: "Choose only TEN items!", 
      /* 
      Fires when a checkbox is checked or unchecked, 
      we are using this option to restrict, 
      user to select no more than 3 option 
      */ 
      click: function (e) { 
       if ($(this).multiselect("widget").find("input:checked").length > 10) { 
        warning.addClass("error").removeClass("success").html("You can only check three checkboxes!"); 
        return false; 
       } 
       else { 
        warning.addClass("success").removeClass("error").html("Check a few boxes."); 
       } 
      } 
      /* 
      .multiselectfilter() 
      Initialize filtering on any of your multiselects 
      by calling multiselectfilter() on the widget. 
      */ 
     }).multiselectfilter(); 
    }); 
</script> 

$('select').multiselect(),而我通過我的dropdown-list Id那麼這種控制不同時給予'select',同時其適用於所有dropdown-list working.Only其工作。但我想申請一個dropdown-list。任何人都可以提議我嗎?

回答

相關問題