我有一个使用以下代码加载 jtable 的页面(此处) :
<script type="text/javascript">
$(document).ready(function () {
$('#EventTypeTableContainer').jtable({
title: 'Table of EventType',
actions: {
listAction: 'Admin/GetEventTypeList',
createAction: 'Admin/CreateEventType',
updateAction: 'Admin/UpdateEventType',
deleteAction: 'Admin/DeleteEventType'
},
fields: {
EventTypeId: {
key: true,
list: true
},
ColourCode: {
title: 'Event Color',
width: '25%',
list: true
},
EventTypeName: {
title: 'Event Type',
width: '50%',
list: true
},
isSystemEventType: {
title: 'Modify/Delete',
width: '25%',
list: true,
create: false,
edit: true
}
}
});
$('#EventTypeTableContainer').jtable('load');
});
</script>
表加载,并显示“无可用数据!”。它确实调用了 listAction,它返回这个 JSON 字符串(例如):
{
"Result":"OK",
"Record":[
{
"EventTypeID":1,
"EventTypeName":"Quiz",
"colourCode":"#FA5858",
"isSystemEventType":false
},
{
"EventTypeID":2,
"EventTypeName":"Assignment",
"colourCode":"#58FA58",
"isSystemEventType":false
},
{
"EventTypeID":3,
"EventTypeName":"MidTerm",
"colourCode":"#5858FA",
"isSystemEventType":false
},
{
"EventTypeID":4,
"EventTypeName":"Exam",
"colourCode":"#FA58F4",
"isSystemEventType":false
}
]
}
我初始化表格的方式或数据格式有什么问题吗?