我的应用程序中有一个jcombobox.我希望它支持多种选择(就像在jlist中一样).有代码示例吗?
Zend Framework 1.12中有一个Zend_Form_Element_Multiselect.如何在Zend Framework 2.0中实现相同的结果?我只看到Zend\Form\Element\MultiCheckbox和Zend\Form\Element\Select
我有一个自定义多选属性,我想参与过滤产品.该属性设置为在分层导航中使用,但不会出现在可用过滤器列表中.可能是由于自定义模型实现?任何人都有一些提示,在哪里检查它为什么不出现?为几个产品设置属性Magento版本使用的是EE 1.11
谢谢
我想设置一个CellList,以便单击一行将切换选择.这样就可以选择多行而不需要按住ctrl键.
我需要做些什么才能让它发挥作用?
class ToggleEventTranslator<T> implements DefaultSelectionEventManager.EventTranslator<T> {
@Override
public boolean clearCurrentSelection(final CellPreviewEvent<T> event) {
return false;
}
@Override
public SelectAction translateSelectionEvent(final CellPreviewEvent<T> event) {
return SelectAction.TOGGLE;
}
}
MultiSelectionModel<ObjProxy> multiSelectionModel = new MultiSelectionModel<ObjProxy>();
ocjCellList.setSelectionModel(multiSelectionModel, DefaultSelectionEventManager
.<ObjProxy> createCustomManager(new ToggleEventTranslator<ObjProxy>()));
Run Code Online (Sandbox Code Playgroud) 所以,情况是这样的:在尝试使用添加下拉框jquery.multiselect插件形式对当前使用jquery.validate有其他领域(文本输入字段,具有单个文本输入插件float数值范围),所有当前验证正确.
当我尝试添加验证规则,我根本无法jquery.validate到任何验证我的多选下拉列表.以下是我的代码片段(所有代码都假设已加载所需的插件 - 请参阅下面的使用版本):
HTML:
<form action="some/action" id="myForm" method="POST">
Input 1: <input type="text" value="" name="input1" maxlength="200" id="input1"><br/>
Input 2: <input type="text" value="" name="input2" maxlength="100" id="input2"><br/>
Input 3: <input type="text" value="" name="input3" maxlength="50" id="input3"><br/>
Select: <select class="someSelect" name="mySelect" id="mySelect" multiple="multiple">
<option value="some_val1">Some Value</option>
<option value="some_val2">Some Other Value</option>
</select>
<input type="submit" value="Submit" />
</form>
Run Code Online (Sandbox Code Playgroud)
Javascript:
$(document).ready(function() {
$('#mySelect').multiselect({
noneSelectedText: 'Select Something (required)',
selectedList: 3,
classes: 'my-select'
});
$.validator.addMethod("needsSelection", function(value, element) {
return $(element).multiselect("getChecked").length > 0;
}); …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用multiselect Bootstrap,我使用了以下代码,也可以在他们的网站上找到(http://davidstutz.github.io/bootstrap-multiselect/),它显示了多选的按钮和as我已经选择了"奶酪和意大利辣香肠"的选项,它已经选择了它们,但每当我点击它时,它都不会打开列表来选择!
<!-- Include the plugin's CSS and JS: -->
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="<?php echo base_url('bootstrap/js/bootstrap-multiselect.js'); ?>"></script>
<link href="<?php echo base_url('bootstrap/css/bootstrap-multiselect.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo base_url('bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo base_url('bootstrap/js/bootstrap.min.js'); ?>"></script>
<!-- Build your select: -->
<select class="multiselect" multiple="multiple" name="my-select[]" id="my-select">
<option value="cheese" selected>Cheese</option>
<option value="tomatoes">Tomatoes</option>
<option value="mozarella">Mozzarella</option>
<option value="mushrooms">Mushrooms</option>
<option value="pepperoni" selected>Pepperoni</option>
<option value="onions">Onions</option>
</select>
<script type="text/javascript">
$(document).ready(function() {
$('.multiselect').multiselect();
});
</script>
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
此外,如果您认为我的问题不明确,请告诉我您需要更多说明哪一部分.
提前谢谢了.
我正在使用Bootstrap Multiselect,我正在使用bootstrap 3.1,并下载了这个脚本
<script type="text/javascript">
$(document).ready(function() {
$('#example28').multiselect({
includeSelectAllOption: true,
enableFiltering: true,
maxHeight: 150
});
});
</script>
<select id="example28" multiple="multiple">
<option value="cheese">Ahmet Burak</option>
<option value="tomatoes">Tomatoes</option>
<option value="mozarella">Mozzarella</option>
<option value="mushrooms">Mushrooms</option>
<option value="pepperoni">Pepperoni</option>
<option value="onions">Onions</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我多次尝试使用过滤器.如果我不在表单中使用第一个char大写,则它找不到任何内容.我该如何解决?
我想在该字段中使用现有值设置多选的值.(即)如果Filed具有值"A,B"意味着我想用现有值添加新值"c"那么,结果将是"A,B,C".
我使用"N/Record"模块SubmitFields API来设置多选字段的值,就像这样
代码:SuiteScript 2.0版本:
初始代码:
var strArrayValue = new Array();
strArrayValue [0] = "A";
strArrayValue [1] = "B";
strArrayValue [2] = "C";
record.submitFields({
type:'purchaseorder',
id:56,
values:{
custbody_multiselectfield: strArrayValue
},
options: {
enableSourcing: false,
ignoreMandatoryFields : true
}
});
Run Code Online (Sandbox Code Playgroud)
它显示如下错误:"您输入了无效类型参数:arg 4"
更新的代码:
var strArrayValue = new Array();
strArrayValue [0] = "A";
strArrayValue [1] = "B";
strArrayValue [2] = "C";
var PORec = record.load({ // Loading Purchase Order Recod
type:"purchaseorder",
id:56,
isDynamic: true
)};
PORec.setValue('custbody_multiselectfield',strArrayValue ); // Setting Value (Array …Run Code Online (Sandbox Code Playgroud) 我注意到在jqgrid演示(http://www.trirand.com/blog/jqgrid/jqgrid.html> Advanced> Multiselect)中,如果启用了分页,则只选择当前页面上的行(可见).
有关让它跨多个页面工作的任何提示.或任何其他替代解决方案?
我的情况如下:
我想要实现的是:
All然后所有,并点击复选框将被取消.HTML文件
<mat-select placeholder="User Type" formControlName="UserType" multiple>
<mat-option *ngFor="let filters of userTypeFilters" [value]="filters.key">
{{filters.value}}
</mat-option>
<mat-option #allSelected (click)="toggleAllSelection()" [value]="0">All</mat-option>
</mat-select>
Run Code Online (Sandbox Code Playgroud)
TS文件
this.searchUserForm = this.fb.group({
userType: new FormControl('')
});
userTypeFilters = [
{
key: 1, value: 'Value 1',
},
{
key: 2, value: 'Value 2',
},
{
key: 3, value: 'Value 3',
},
{
key: 4, value: 'Value 4',
}
]
toggleAllSelection() {
if (this.allSelected.selected) {
this.searchUserForm.controls.userType …Run Code Online (Sandbox Code Playgroud) multi-select ×10
javascript ×2
jquery ×2
php ×2
angular6 ×1
arrays ×1
gwt ×1
gwt-2.4 ×1
jcombobox ×1
jqgrid ×1
magento ×1
netsuite ×1
suitescript ×1
swing ×1
zend-form ×1