如何在 JTable 列中显示 HyperLink 数据?
How to display HyperLink Data in JTable column?
我想显示从 jtable 接收到的数据的 href。
下面是代码片段。
$('#JarDistHist').jtable({
title: 'Jar Distribution History',
paging: true,
//pageSize: 10,
sorting: true,
defaultSorting: 'Date ASC',
actions: {
listAction: 'StudentActions.php?action=list&DistId=' + cname + '&fitem=' + fitem + '',
deleteAction: 'StudentActions.php?action=delete'
},
fields: {
id: {
key: true,
create: false,
edit: false,
list: false,
},
Date: {
title: ' Date',
type: 'date',
displayFormat: 'dd-mm-y',
width: '40%',
options: '<a href="JarFillingDetail.php?id">'
},
看看这个 link : http://blogs.lessthandot.com/index.php/WebDev/ServerProgramming/nancy-and-jtable-formatting-your/
我想这就是你想要的。
添加字段display
。
When we configure our fields for jtable we have a display attribute
that takes a function and in that function we can do our formatting.
display: function (data) {
return $('<a href="JarFillingDetail.php?id="' + data.Id + '"></a>');
}
我想显示从 jtable 接收到的数据的 href。
下面是代码片段。
$('#JarDistHist').jtable({
title: 'Jar Distribution History',
paging: true,
//pageSize: 10,
sorting: true,
defaultSorting: 'Date ASC',
actions: {
listAction: 'StudentActions.php?action=list&DistId=' + cname + '&fitem=' + fitem + '',
deleteAction: 'StudentActions.php?action=delete'
},
fields: {
id: {
key: true,
create: false,
edit: false,
list: false,
},
Date: {
title: ' Date',
type: 'date',
displayFormat: 'dd-mm-y',
width: '40%',
options: '<a href="JarFillingDetail.php?id">'
},
看看这个 link : http://blogs.lessthandot.com/index.php/WebDev/ServerProgramming/nancy-and-jtable-formatting-your/
我想这就是你想要的。
添加字段display
。
When we configure our fields for jtable we have a display attribute that takes a function and in that function we can do our formatting.
display: function (data) {
return $('<a href="JarFillingDetail.php?id="' + data.Id + '"></a>');
}