【发布时间】:2016-03-10 06:24:15
【问题描述】:
我正在使用jquery jtable 在表中填充一些数据。我想覆盖其中的updateAction。我想在updateAction popup 中添加更多字段。甚至可能吗?如果是,我该如何实现?
<script type="text/javascript">
$(document).ready(function() {
$('#TableContainer').jtable({
title : 'User List',
actions : {
listAction : 'Controller?action=list',
updateAction: 'Controller?action=update',
deleteAction: 'Controller?action=delete'
},
fields : {
num : {
title : 'No',
width : '30%',
key : true,
list : true,
create : true
},
psid : {
title : 'Id',
width : '30%',
edit : false
},
roles : {
title : 'Roles',
width : '30%',
edit : true
// options: 'Controller?action=list'
/* options:["jj","kk"] */
},
country : {
title : 'Country',
width : '20%',
edit : true
},
/* CustomAction: {
title: '',
width: '1%',
sorting: false,
create: false,
edit: false,
list: true,
display: function (data) {
if (data.record) {
return '<button title="Edit Record" class="jtable-command-button jtable-edit-command-button" onclick="alert(' + data.record.TicketId + '); return false;"><span>Edit Record</span></button>';
}
}
},
*/
recordsLoaded: function(event, data) {
$('.jtable-data-row').click(function() {
var row_id = $(this).attr('data-record-key');
alert('clicked row with id '+row_id);
});
}
}
});
$('#TableContainer').jtable('load');
});
</script>
我想从下拉列表中的 json 动态添加值。有什么办法吗?
【问题讨论】:
标签: jquery jsp jquery-jtable