相关疑难解决方法(0)

bootstrap multiselect获取选定的值

如何重新启用onChange我的多选下拉列表中的所有选定值.这里使用插件.试着使用以下但我认为我走错了路

$('#multiselect1').multiselect({
        selectAllValue: 'multiselect-all',
        enableCaseInsensitiveFiltering: true,
        enableFiltering: true,
        maxHeight: '300',
        buttonWidth: '235',
        onChange: function(element, checked) {
            var brands = $('#multiselect1 option:selected');
            var selection = [];
            $(brands).each(function(index, brand){
                selection.push(brand);
            });

            console.log(selection);
        }
    });
Run Code Online (Sandbox Code Playgroud)

找到了

$('#multiselect1').multiselect({
    selectAllValue: 'multiselect-all',
    enableCaseInsensitiveFiltering: true,
    enableFiltering: true,
    maxHeight: '300',
    buttonWidth: '235',
    onChange: function(element, checked) {
        var brands = $('#multiselect1 option:selected');
        var selected = [];
        $(brands).each(function(index, brand){
            selected.push([$(this).val()]);
        });

        console.log(selected);
    }
});
Run Code Online (Sandbox Code Playgroud)

jquery multi-select twitter-bootstrap

28
推荐指数
4
解决办法
9万
查看次数

如何在django中创建列表字段

如何在Django(Python)中创建ListField,就像在Google App Engine(Python)中的ListProperty属性一样?我的数据是这样的列表:3,4,5,6,7,8.

我必须定义什么属性以及如何从中获取值?

python django google-app-engine

27
推荐指数
3
解决办法
4万
查看次数