我刚刚开始在我的项目中使用 jtable 并且遇到了问题。创建 jTable 实例后,我想更改此实例的一些常规选项,但似乎不起作用。
例如,
$(document).ready(function () {
$('#PersonTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: '/GettingStarted/PersonList',
createAction: '/GettingStarted/CreatePerson',
updateAction: '/GettingStarted/UpdatePerson',
deleteAction: '/GettingStarted/DeletePerson'
},
fields: {
PersonId: {
key: true,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});
$('#PersonTableContainer').jtable({ title:'chang title'}); //this doesn't work
// below also doesn't work
$.extend(true, $.hik.jtable.prototype.options, {title: 'change title'} );
});
如何动态更改 jtable 的常规选项、字段选项和操作?