我想使用弹出菜单进行注册,我必须在某处使用单选按钮。它应该有多种选择,只有一种可以选择。
这是我的代码:
这是我的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;
}
);
你能帮我吗?
答案 0 :(得分:0)
您也使用了复选框。 单选按钮不允许多项选择。