实际上我想在数据库中的 bool 值列表中显示复选框
OriginatingLocation: {
title: 'Originating Location',
width: '30%',
list: true,
type:checkbox,
create: false,
edit: false
},
最佳答案
看起来您不想添加或编辑记录,那么这很容易。
jTable damo页面(PagingAndSorting demo)有display:
功能,大家可以看看 here 。您还可以找到有关 jTable 的更多信息 ApiReference在这里。
下面的代码可能会帮助你
OriginatingLocation: {
title: 'Originating Location',
width: '30%',
list: true,
display: function (data) {
if (data.record.OriginatingLocation == true)
{
return '<input type="checkbox" checked>';
}
else
{
return '<input type="checkbox">';
}
},
create: false,
edit: false
},
这里的 OriginatingLocation
是 Boolean 字段。
关于jquery jtable 复选框未显示在列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27814335/