0
我试图编写代码,当单击链接时将显示网格,并且我设法获取链接显示,但未能在网格底部显示网格页。谢谢你的帮助。使用打字稿显示从点击链接的网格
*
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.container)没有返回jQuery对象。 – 2014-10-09 09:29:39
是否意味着它必须是this.divId? – user3635322 2014-10-09 09:43:55
可能。也许在浏览器中使用断点并检查当前作用域中的变量可能会有所帮助。这样你就可以看到你的当前“this”引用是否有成员divId及其值。 – 2014-10-09 09:49:09