欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jtable列中自定义button示例代码

程序员文章站 2023-11-09 12:23:52
代码如下: information: { title: 'info', width: '5%', sorting: false, ed...

代码如下:


information: {
title: 'info',
width: '5%',
sorting: false,
edit: true,
create: true,
type:'textarea',
display: function (customerdata) {
var $img = $('<img src="content/images/document_properties.png" title="view and edit information" />');
$img.click(function () {
$('#customerstablecontainer').jtable('openchildtable',
$img.closest('tr'),
{
title: customerdata.record.name + ' - information',
actions: {
listaction: 'ajax/customer_info_actions.php?action=list&searchterm=' + customerdata.record.customernumber,
},
fields: {
customernumber: {
title: 'number',
key: true,
create: false,
edit: false,
list: false
},
information: {
title:'information',
create: false,
edit: true,
list: true,
type:'textarea'
},

}
}, function (data) { //opened handler
data.childtable.jtable('load');
});
});
return $img;
}
},
'''''