我读了Jtable引用并看了样本, 我想在Jtable结果中添加复选框列,每个列都有唯一的ID。
默认情况下是否有Jquery Jtable复选框列?
或者每个人都可以告诉我样品吗? 这是我的代码:
$('#PersonTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: '/GettingStarted/PersonList',
createAction: '/GettingStarted/CreatePerson',
updateAction: '/GettingStarted/UpdatePerson',
deleteAction: '/GettingStarted/DeletePerson'
},
fields: {
PersonId: {
key: true,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});
答案 0 :(得分:12)
您是否看过此页:SelectingRows
您可以像这样添加复选框字段:
RowCheckbox: {
title: 'Status',
width: '12%',
type: 'checkbox',
values: { 'false': 'Passive', 'true': 'Active' },
defaultValue: 'true'
},