简体   繁体   English

Jtable仅在逐步调试器时显示

[英]Jtable only displays when stepping through debugger

Hi I am struggling to display my jtable. 嗨,我在努力展示我的jtable。 It only displays when I step through the javascript with the debugger. 它仅在我使用调试器逐步浏览javascript时显示。

$("body").on("click", "#tabRole", function () {
        document.getElementById("1").className = "inactive";
        document.getElementById("2").className = "active";

        $('#Admin-details').load('../Admin/ADRoleAdmin');
        jTableRoles();
    });

This method loads ADRoleAdmin as a partial view into a div. 此方法将ADRoleAdmin作为局部视图加载到div中。 Then jTableRoles() should load the jtable into a div (jTableRoles) inside ADRoleAdmin: 然后,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');
    });
}

Please tell me what I am doing wrong or what I can do different to make it work. 请告诉我我做错了什么,或者我可以做些什么才能使其正常工作。

Looping through the steps takes extra time. 循环执行这些步骤需要花费额外的时间。 It looks like the load of ADRoleAdmin is not finished on the moment the jTable is loaded. 看起来jTable加载时ADRoleAdmin的加载尚未完成。

Try to start the jtable after a certain timeout to check. 尝试在超时后启动jtable进行检查。 Preferably load the ADRoleAdmin an on it's postback load the jTable 最好在其回发时加载ADRoleAdmin并加载jTable

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

相关问题 仅在使用调试器执行操作时执行 - Action executing only when stepping with debugger 最小化窗口功能仅在调试器(C#-Console)中逐步调试时有效 - Minimize Window function only works when stepping through in Debugger (C# - Console) 检测调试器是否已连接*和*单步执行 - Detect if Debugger is Attached *and* stepping through 除非逐步调试,否则控制台程序将挂起 - Console program hangs unless stepping through with debugger 更新集合时出现奇怪的DB上下文行为(在调试器中逐步执行代码时有效) - Strange DB-context behaviour when updating collection (Works when stepping through the code in debugger) 我单步执行程序时只会得到Stackoverflow异常 - I Only get a Stackoverflow exception when stepping through program NHibernate只积极加载Dictionary <map> 单步执行代码时 - NHibernate only eagerly loads Dictionary <map> when stepping through code C# 仅在单步执行代码时出现调试错误 - C# Debugging Error Only When Stepping Through Code 单步执行到单步执行时功能会有所不同 - Function behaves differently when stepping through to when stepping over Unity3D调试器无法单步调试带有DebuggerStepThrough属性的方法 - Unity3D Debugger not stepping through method with DebuggerStepThrough Attribute
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM