jQuery JTable复选框未显示在列表中 [英] jquery jtable Checkbox is not showing in the list
本文介绍了jQuery JTable复选框未显示在列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
实际上我想在列表中显示复选框,以显示数据库中的布尔值
actually i want to display Checkbox in the list for Boolean values from database
OriginatingLocation: {
title: 'Originating Location',
width: '30%',
list: true,
type:checkbox,
create: false,
edit: false
},
推荐答案
似乎您不想添加或编辑记录,这非常容易.
具有display:
功能的jTable damo页面(PagingAndSorting演示),可以在此处看到.您还可以在此处找到有关jTable的更多信息 ApiReference .
下面的代码可能会帮助您
It seems like you dont want to add or edit the record then it is very easy.
jTable damo page (PagingAndSorting demo) having display:
function, You can see it here. Also you can find more about jTable ApiReference here.
Below code may help you
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复选框未显示在列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文