使用typescript显示单击的链接中的网格

Display a grid from a clicked link using typescript

本文关键字:链接 网格 单击 typescript 显示 使用      更新时间:2023-09-26

我正试图编写代码,在单击链接时显示网格,我设法显示了链接,但未能在页面底部显示网格。谢谢你的帮助。

*

export function setCustomLinkContent(divId: string, field: propertybox.Field) {
            var container = $('#' + divId);
            container.height(70);
            container.width(260);
            container.append("<p><a target='_blank' href='"http://localhost'">View all works</a></p>");
            this.container.prepareGridContainer();
            var gridContainer = $("#" + this.container);
            var gridContHeight = gridContainer.height() - 27 - 43;
            var workHtml =
                "<div id='" + this.workContainer + "-heading' class='orm-table-title'>" +
                "<label>" + this.headerLabel + "</label>" +
                "</div>" +
                "<div id='" + this.workContainer + "-table' class='map-work-grid' style='height: " + gridContHeight + "px'>" +
                "<table style='margin: 0 auto; width: 100%; overflow-x: auto'>" +
                "<thead>" +
                "<tr id='" + this.tableHeader + "'></tr>" +
                "</thead>" +
                "<tbody id='" + this.tableBody + "'></tbody>" +
                "</table>" +
                "</div>";
            gridContainer.append(workHtml);
        }

*

很可能您有错误的this。由于函数不是类的一部分,因此在这里似乎没有意义。

有关this的详细信息:https://www.youtube.com/watch?v=tvocUcbCupA&hd=1