I want 4 columns in Grid, First column is Name and next three columns are permissions - Read, write and None. If user is having Read and write access, I want check Write Radiobutton. If user is having Read, Read Radiobutton and Neither then check None. How can I do this ? Below is the code I tried.
var dataSource = new kendo.data.DataSource({
transport: {
read: {
type: "GET",
dataType: "json",
url: "/Home/GetUsers",
data: UserData
}
},
schema: {
model: {
id: "Id",
fields: {
Id: { editable: false },
Name: { editable: false },
Read: { editable: true },
Write: { editable: true },
None: { editable: true}
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [
{ field: "Id", hidden: true },
{ field: "Name", title: "Name" },
{ field: "Read", title: "Read", template: "<input type='radio' name='Read' value='#= Read #' />" },
{ field: "Write", title: "Write", template: "<input type='radio' name='ReadWrite' value='#= Write #' />" },
{ field: "None", title: "None", template: "<input type='radio' name='None' value='#= None #' />" }
],
});
var dataSource = new kendo.data.DataSource({
transport: {
read: {
type: "GET",
dataType: "json",
url: "/Home/GetUsers",
data: UserData
}
},
schema: {
model: {
id: "Id",
fields: {
Id: { editable: false },
Name: { editable: false },
Read: { editable: true },
Write: { editable: true },
None: { editable: true}
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [
{ field: "Id", hidden: true },
{ field: "Name", title: "Name" },
{ field: "Read", title: "Read", template: "<input type='radio' name='Read' value='#= Read #' />" },
{ field: "Write", title: "Write", template: "<input type='radio' name='ReadWrite' value='#= Write #' />" },
{ field: "None", title: "None", template: "<input type='radio' name='None' value='#= None #' />" }
],
});