Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.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
Javascript 如何添加具有多选功能的单选按钮_Javascript_Jquery_Html_Kendo Ui_Kendo Grid - Fatal编程技术网

Javascript 如何添加具有多选功能的单选按钮

Javascript 如何添加具有多选功能的单选按钮,javascript,jquery,html,kendo-ui,kendo-grid,Javascript,Jquery,Html,Kendo Ui,Kendo Grid,我想使用一个弹出菜单注册,我必须使用单选按钮在它的某个地方。它应该有多个选择,只有一个可以选择 这是我的密码: 这是我的PersonModel.js define([ 'kendo/kendo.data.min', 'robe/Validations'], function () { var PersonModel = kendo.data.Model.define({ id: "oid", fields: { oid: { editab

我想使用一个弹出菜单注册,我必须使用单选按钮在它的某个地方。它应该有多个选择,只有一个可以选择

这是我的密码:

这是我的PersonModel.js

define([
'kendo/kendo.data.min', 'robe/Validations'], function () {

var PersonModel = kendo.data.Model.define({
    id: "oid",
    fields: {
        oid: {
            editable: false,
            nullable: true,
            type: "string"
        },
        lastUpdated: {
            editable: true,
            nullable: true,
            type: "string"
        },
        tckNo:{
            editable:true,
            nullable:false,
            type:"string",
            validation :getValidations("tckNo","T.C. Kimlik Numarası",true,false,11,11,"[0-9]")
        },
        name: {
            editable: true,
            nullable: false,
            type: "string"
        },
        surname: {
            editable: true,
            nullable: false,
            type: "string"
        },
        birthday: {
            editable: true,
            nullable: false,
            type: "date"
        },
        isSingle:{
            editable:true,
            nullable:false,
            type:"boolean"
        }
    }
});
return PersonModel;});
这里是PersonDataSource.js

define(['common/SingletonDataSource', './PersonModel'], function (SingletonDataSource, personModel) {

var personDataSource = SingletonDataSource.define({
    name: "personDataSource",
    parameters: {
        transport: {
            read: {
                type: "GET",
                url: AdminApp.getBackendURL() + "person/all",
                dataType: "json",
                contentType: "application/json"
            },
            update: {
                type: "POST",
                url: AdminApp.getBackendURL() + "person",
                dataType: "json",
                contentType: "application/json"
            },
            destroy: {
                type: "DELETE",
                url: AdminApp.getBackendURL() + "person",
                dataType: "json",
                contentType: "application/json"
            },
            create: {
                type: "PUT",
                url: AdminApp.getBackendURL() + "person",
                dataType: "json",
                contentType: "application/json"
            },
            parameterMap: function (options, operation) {
                if (operation !== "read") {
                    return kendo.stringify(options);
                }
            }
        },
        batch: false,
        pageSize: 25,
        schema: {
            model: personModel
        }
    }
});

return personDataSource;});
这里是PersonManagement.js:

 define([
    'text!./PersonManagement.html',
    './PersonDataSource',
    'kendo/kendo.grid.min',
    'robe/view/RobeView'],
function(view,PersonDataSource){
    var PersonManagementView = require('robe/view/RobeView').define({
        name:"PersonManagementView",
        html:view,
        containerId:"container",
        initialize:function(){
            var grid = $("#personGrid").kendoGrid({
                dataSource: PersonDataSource.get(),
                sortable: true,
                autoBind: false,
                pageable: {
                    refresh: true
                },
                toolbar: [
                    {
                        name: "create",
                        text: "Yeni Kişi"
                    }
                ],
                columns: [
                    {
                        field:"tckNo",
                        title:"TC Kimlik Numarası",
                        format:"{0:n0}"
                    },
                    {
                        field: "name",
                        title: "Ad"

                    },
                    {
                        field: "surname",
                        title: "Soyad"
                    },
                    {
                        field: "birthday",
                        title: "Doğum Günü"
                    },
                    {
                        command: [
                            {
                                name: "edit",
                                text: {
                                    edit:   "",
                                    update: "Tamam",
                                    cancel: "İptal"
                                },
                                className: "grid-command-iconfix"
                            },
                            {
                                name: "destroy",
                                text: "",
                                className: "grid-command-iconfix"
                            }
                        ],
                        title: " ",
                        width: "120px"
                    }
                ],
                editable: {
                    mode: "popup",
                    window: {
                        title: "Kayıt".i18n()
                    },
                    confirmation: "Silmek istediğinizden emin misiniz?".i18n(),
                    confirmDelete: "Yes"
                }
            });
        }
    });
    return PersonManagementView;
}
))


你能帮帮我吗?

你也可以使用复选框。
单选按钮不允许多选

这不是一个真正的答案,它与用户体验更相关,但传统上我认为复选框将用于多重选择。通常我只希望被允许为单选按钮列表选择on选项。也许你可以改为切换到复选框列表?我不想选择多个选项,我想从多个选项(选项)中选择一个。你不能。单选按钮可供选择。对于多选,您需要复选框。检查jQuery是否至少检查了一个。一个月前也有同样的问题,我想我无法解释。我不想多选。我的意思是用户可以从多个选项中选择一个。我知道单选按钮是怎么工作的。你现在明白了吗,朋友?谢谢你的兴趣。好吧,也许你可以摆弄一下?我真的不理解你的问题。你是一个很好的人,你的婚姻状况只有三种选择。你可能是单身,你可能是已婚,你可能是寡妇。对于这个问题,您不能有任何选项,也不能同时选择2个选项。您必须只选择一个。