如何仅在客户端从JQuery JTable获取json格式的所有记录。
我的要求是,我有一个项目信息插入到数据库中,以及与此项目相关的作者列表。我在JQuery Jtable中维护此列表。
单击保存按钮时,我会将所有表单信息发送到servlet。我还想要JSON格式的作者列表,这样我就可以将其发送到servlet。
Is Is possible.see my JQuery jtable在下面
$('#AuthorTableContainer').jtable({
title: 'Authors',
selecting: true,
edit: true,
selecting: true, //Enable selecting
multiselect: true, //Allow multiple selecting
selectingCheckboxes: true, //Show checkboxes on first column
actions: {
deleteAction : function (data) {
$('#AuthorTableContainer').jtable('deleteRecord', {
key: data.authorId,
clientOnly:true
});
}},
fields: {
authorId: {
title: 'authorId',
key:true,
sorting:true,
width: '30%'
},
Name: {
title: 'Name',
width: '30%'
},
phone: {
title: 'phone',
width: '30%'
},
Email: {
title: 'Email',
width: '30%'
}
}
});
}
};我只想在客户端获得JSON格式的作者列表
发布于 2015-09-28 18:13:14
我找到解决方案了。我们可以在jtable中使用addRecord方法添加json对象行。如下所示。http://jtable.org/ApiReference/Methods#met-addRecord
https://stackoverflow.com/questions/26293974
复制相似问题