繁体   English   中英

Jtable仅在逐步调试器时显示

[英]Jtable only displays when stepping through debugger

嗨,我在努力展示我的jtable。 它仅在我使用调试器逐步浏览javascript时显示。

$("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加载到ADRoleAdmin内的div(jTableRoles)中:

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');
    });
}

请告诉我我做错了什么,或者我可以做些什么才能使其正常工作。

循环执行这些步骤需要花费额外的时间。 看起来jTable加载时ADRoleAdmin的加载尚未完成。

尝试在超时后启动jtable进行检查。 最好在其回发时加载ADRoleAdmin并加载jTable

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM