Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导选择器选择器设置数据最大值选项不工作_Twitter Bootstrap - Fatal编程技术网

Twitter bootstrap 引导选择器选择器设置数据最大值选项不工作

Twitter bootstrap 引导选择器选择器设置数据最大值选项不工作,twitter-bootstrap,Twitter Bootstrap,我正在寻找以下代码以获得工作,但这些代码都不起作用:( $(“#comboColumnOption”+计数器)。选择器('maxOptions','3');//不工作 `$("#comboColumnOption"+counter).data("data-max-options", 3); //Not setting` up as when I click it allowed me to select more than 3 ...... $("#comboColumnOption"

我正在寻找以下代码以获得工作,但这些代码都不起作用:(

$(“#comboColumnOption”+计数器)。选择器('maxOptions','3');//不工作

`$("#comboColumnOption"+counter).data("data-max-options", 3); //Not setting` up as when I click it allowed me to select more than 3 ......

    $("#comboColumnOption"+counter).selectpicker('maxOptions', '3');    $("#comboColumnOption"+counter).selectpicker('render'); //Not work
我正在使用此网站上的selectpicker:

试试这个

$('.selectpicker').selectpicker({
      maxOptions:2
  });
在使用javascript进行设置时,不应使用data max选项

试试这个

$('.selectpicker').selectpicker({
      maxOptions:2
  });
在使用javascript进行设置时,不应使用data max选项

试试这个

$('.selectpicker').selectpicker({
      maxOptions:2
  });
在使用javascript进行设置时,不应使用data max选项

试试这个

$('.selectpicker').selectpicker({
      maxOptions:2
  });
在使用javascript进行设置时,不应使用data max选项

呼叫

$('.selectpicker').selectpicker({
    maxOptions:2
});
只工作一次

如果需要根据某些其他参数更改maxOptions-更改maxOptions仅在第一次起作用。即使调用:

$( '#periodselect' ).selectpicker('refresh');
$( '#periodselect' ).selectpicker('render');
$( '#periodselect' ).selectpicker('init');
这是我的密码:

if ( i == 0 && periodDisplayName != "Aggregated all" ) { 
    if ( $("#periodselect optgroup").attr("data-max-options") == "15" ) {
        $('#periodselect').selectpicker({
            maxOptions:2
        );
    }
} else if ( i == 0 ){
    if ( $("#periodselect optgroup").attr("data-max-options") == "2" ) {
        $('#periodselect').selectpicker({
            maxOptions:15
        });
        $("#periodselect optgroup").attr("data-max-options", 15);
        $('#periodselect').selectpicker('maxOptions', 15);
        $('#periodselect').selectpicker("data-max-options", 15);
        var selRefresh = $( '#periodselect' ).selectpicker('refresh');
        var selRender = $( '#periodselect' ).selectpicker('render');
        var selInit = $( '#periodselect' ).selectpicker('init');
    }
}
测试它时,我首先看到maxOption被设置为2(从15开始),然后我想看看maxOption是否可以再次设置为15,但事实并非如此

$('.selectpicker').selectpicker({
    maxOptions:2
});
只工作一次

如果需要根据某些其他参数更改maxOptions-更改maxOptions仅在第一次起作用。即使调用:

$( '#periodselect' ).selectpicker('refresh');
$( '#periodselect' ).selectpicker('render');
$( '#periodselect' ).selectpicker('init');
这是我的密码:

if ( i == 0 && periodDisplayName != "Aggregated all" ) { 
    if ( $("#periodselect optgroup").attr("data-max-options") == "15" ) {
        $('#periodselect').selectpicker({
            maxOptions:2
        );
    }
} else if ( i == 0 ){
    if ( $("#periodselect optgroup").attr("data-max-options") == "2" ) {
        $('#periodselect').selectpicker({
            maxOptions:15
        });
        $("#periodselect optgroup").attr("data-max-options", 15);
        $('#periodselect').selectpicker('maxOptions', 15);
        $('#periodselect').selectpicker("data-max-options", 15);
        var selRefresh = $( '#periodselect' ).selectpicker('refresh');
        var selRender = $( '#periodselect' ).selectpicker('render');
        var selInit = $( '#periodselect' ).selectpicker('init');
    }
}
测试它时,我首先看到maxOption被设置为2(从15开始),然后我想看看maxOption是否可以再次设置为15,但事实并非如此

$('.selectpicker').selectpicker({
    maxOptions:2
});
只工作一次

如果需要根据某些其他参数更改maxOptions-更改maxOptions仅在第一次起作用。即使调用:

$( '#periodselect' ).selectpicker('refresh');
$( '#periodselect' ).selectpicker('render');
$( '#periodselect' ).selectpicker('init');
这是我的密码:

if ( i == 0 && periodDisplayName != "Aggregated all" ) { 
    if ( $("#periodselect optgroup").attr("data-max-options") == "15" ) {
        $('#periodselect').selectpicker({
            maxOptions:2
        );
    }
} else if ( i == 0 ){
    if ( $("#periodselect optgroup").attr("data-max-options") == "2" ) {
        $('#periodselect').selectpicker({
            maxOptions:15
        });
        $("#periodselect optgroup").attr("data-max-options", 15);
        $('#periodselect').selectpicker('maxOptions', 15);
        $('#periodselect').selectpicker("data-max-options", 15);
        var selRefresh = $( '#periodselect' ).selectpicker('refresh');
        var selRender = $( '#periodselect' ).selectpicker('render');
        var selInit = $( '#periodselect' ).selectpicker('init');
    }
}
测试它时,我首先看到maxOption被设置为2(从15开始),然后我想看看maxOption是否可以再次设置为15,但事实并非如此

$('.selectpicker').selectpicker({
    maxOptions:2
});
只工作一次

如果需要根据某些其他参数更改maxOptions-更改maxOptions仅在第一次起作用。即使调用:

$( '#periodselect' ).selectpicker('refresh');
$( '#periodselect' ).selectpicker('render');
$( '#periodselect' ).selectpicker('init');
这是我的密码:

if ( i == 0 && periodDisplayName != "Aggregated all" ) { 
    if ( $("#periodselect optgroup").attr("data-max-options") == "15" ) {
        $('#periodselect').selectpicker({
            maxOptions:2
        );
    }
} else if ( i == 0 ){
    if ( $("#periodselect optgroup").attr("data-max-options") == "2" ) {
        $('#periodselect').selectpicker({
            maxOptions:15
        });
        $("#periodselect optgroup").attr("data-max-options", 15);
        $('#periodselect').selectpicker('maxOptions', 15);
        $('#periodselect').selectpicker("data-max-options", 15);
        var selRefresh = $( '#periodselect' ).selectpicker('refresh');
        var selRender = $( '#periodselect' ).selectpicker('render');
        var selInit = $( '#periodselect' ).selectpicker('init');
    }
}

测试它时,我首先看到maxOption设置为2(从15开始),然后我想看看maxOption是否可以再次设置为15,但事实并非如此。

嗨,Shamal,谢谢兄弟,它可以工作,但您能否告诉我如何在不使用以下命令的情况下应用selectAll或DecelectAll,因为以下命令不起作用$(“#comboColumnOption”+计数器)。selectpicker('Descelect');语法正确。我在我的plunker中添加了Descelect功能。如果计数器变量出现问题,请检查您的代码。您好,Shamal,谢谢兄弟,它可以工作,但您能否让我知道如何在不使用以下命令的情况下应用selectAll或Descelect,因为以下命令不起作用$(“#comboColumnOption”+计数器)。selectpicker('Descelect');语法正确。我在我的plunker中添加了Descelect功能。如果计数器变量出现问题,请检查您的代码。您好,Shamal,谢谢兄弟,它可以工作,但您能否让我知道如何在不使用以下命令的情况下应用selectAll或Descelect,因为以下命令不起作用$(“#comboColumnOption”+计数器)。selectpicker('Descelect');语法正确。我在我的plunker中添加了Descelect功能。如果计数器变量出现问题,请检查您的代码。您好,Shamal,谢谢兄弟,它可以工作,但您能否让我知道如何在不使用以下命令的情况下应用selectAll或Descelect,因为以下命令不起作用$(“#comboColumnOption”+计数器)。selectpicker('deselectAll');语法正确。我在plunker中添加了取消选择功能。如果计数器变量有问题,请检查代码。