在 jQuery 对话框中,我遇到了 jQuery UI MultiSelect 小部件搜索过滤器没有获得焦点的问题。我遇到的问题可以通过在浏览器中查看以下 HTML 页面来重现:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style media="screen" title="currentStyle" type="text/css">
@import "styles/jquery.multiselect.css";
@import "styles/jquery.multiselect.filter.css";
@import "styles/assets/prettify.css";
@import "styles/jquery.ui.all.css";
@import "styles/style.css";
</style>
<script src="scripts/jquery-2.0.0.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script src="scripts/assets/prettify.js"></script>
<script src="scripts/jquery.multiselect.js"></script>
<script src="scripts/jquery.multiselect.filter.js"></script>
</head>
<body>
<input id="create-package" type="button" value="Open Dialog" />
<div id="package-dialog-form" title="Create new package">
<p class="validateTips">All form fields are required.</p>
<form>
<fieldset>
<select multiple="multiple" style="width:370px">
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
<option value="orange">Orange</option>
<option value="purple">Purple</option>
<option value="yellow">Yellow</option>
<option value="brown">Brown</option>
<option value="black">Black</option>
</select>
</fieldset>
</form>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("select").multiselect().multiselectfilter();
$( "#package-dialog-form" ).dialog({
autoOpen: false,
height: 360,
width: 740,
modal: true,
buttons: {
"Create": function() {
var bValid = true;
allFields.removeClass( "ui-state-error" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
$( "#create-package" ).button().click(function() {
$( "#package-dialog-form" ).dialog( "open" );
});
});
</script>
</body>
</html>
谁能帮我解决这个问题?这是我的问题http://jsfiddle.net/tim_kruger/7ubdE/的一个分叉 jqfiddle 。