0
嗨,我努力顯示我的jtable。它只在我用調試器遍歷javascript時顯示。Jtable只顯示在通過調試器步進時
$("body").on("click", "#tabRole", function() {
document.getElementById("1").className = "inactive";
document.getElementById("2").className = "active";
$('#Admin-details').load('../Admin/ADRoleAdmin');
jTableRoles();
});
此方法將ADRoleAdmin作爲局部視圖加載到div中。然後jTableRoles()應該JTable中加載到一個div(jTableRoles)內ADRoleAdmin:
var jTableRoles = function() {
$(function() {
debugger;
$('#jTableRoles').jtable({
paging: true,
pageSize: 20,
sorting: true,
title: 'Roles',
onRowEdit: function (event, data) {
UpdateRoleDetails(data.records.RoleId, data.records.RoleName);
},
actions: {
listAction: '../Admin/GetRoles',
updateAction: 'dummy'
},
toolbar: {
items: [{
icon: '../Content/images/Misc/Add icon.png',
text: 'Create New',
click: function() {
UpdateRoleDetails(0, '');
}
}]
},
fields: {
Id: {
key: true,
list: false
},
Name: {
title: 'Role name',
},
Description: {
title: 'Role description',
sorting: false
}
}
});
$('#jTableRoles').jtable('load');
});
}
請告訴我,我做錯了還是什麼我可以做的不同,以使其發揮作用。