<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();
精彩评论