开发者

How to set Jquery dropdown checklist?

开发者 https://www.devze.com 2023-03-11 06:31 出处:网络
<script type=\"text/javascript\"> var $j = jQuery.noConflict(); $j(document).ready( function(){ //is this right syntax for jqu开发者_如何学Cery dropdown plugin??
<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(document).ready(

function(){

   //is this right syntax for jqu开发者_如何学Cery dropdown plugin??
   $j('#data .xyz').dropdownchecklist(); 
   }
 }
);
</script>

<div id="data">
 <table class="xyz">
  <tbody>
   <tr>
    <td>
      Name:<br /> <%=select_tag 'Names', options_from_collection_for_select(@available_names, 'id', 'name', selected = params[:Names].to_i) %> 
   </td>
  </tr>
 <tbody>
<table/>

Is it the right way for using jquery dropdown checklist?? here is the link for plugin

http://dropdown-check-list.googlecode.com/svn/trunk/doc/dropdownchecklist.html


#data .xyz should refer to a <select> element with <option>'s to turn into a dropdown check list. What your jQuery selector is doing, is pick up the <table> element with the class .xyz.

You should change your selector into: $j('#data .xyz select').dropdownchecklist();

0

精彩评论

暂无评论...
验证码 换一张
取 消