我的应用使用谷歌地图与谷歌api。我在地图上显示了所有的引脚,当我点击一个引脚时,我设置了弹出窗口以显示一个html表,其中包含与地图上每个引脚相关联的项目。我使用StringBuilder来创建这个表,然后我将它写入InfoWindow.aspx页面。我的客户端现在希望能够按列标题对此表进行排序,但我似乎找不到在google弹出窗口上设置回发的方法。我尝试将programmaticaly创建gridview并将其添加到页面上的占位符,但这不起作用。我似乎无法在此页面上拖动GridView ...弹出窗口将不会显示。 有没有人必须这样做或者能指出我正确的方向? 感谢
这是我到目前为止所得到的:
StringBuilder sb = new StringBuilder();
sb.AppendLine("<head><link rel='stylesheet' href='http://tablesorter.com/docs/css/jq.css' type='text/css'media='print, projection, screen' /><link rel='stylesheet' href='http://tablesorter.com/themes/blue/style.css' type='text/css' media='print, projection, screen' /> <script type='text/javascript' src='http://tablesorter.com/jquery-latest.js'></script><script type='text/javascript' src='http://tablesorter.com/__jquery.tablesorter.min.js'></script><script type='text/javascript' src='http://tablesorter.com/docs/js/chili/chili-1.8b.js'></script><script type='text/javascript' src='http://tablesorter.com/docs/js/docs.js'></script>");
sb.AppendLine("<script type='text/javascript'>");
sb.AppendLine(" $(document).ready(function () {");
//// call the tablesorter plugin
sb.AppendLine(" $('#Projects').tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra']});");
// sort on the first column and third column, order asc
sb.AppendLine("});");
sb.AppendLine("});");
sb.AppendLine("</script>");
sb.AppendLine("</head>");
sb.AppendLine("<br /><table id='Projects' class='tablesorter' cellspacing='0' >");
sb.AppendLine("<thead>");
sb.AppendLine("<tr>");
sb.AppendLine("<th>");
sb.AppendLine("File Number");
sb.AppendLine("</th>");
sb.AppendLine("<th>");
sb.AppendLine("Ref. Number");
sb.AppendLine("</th>");
sb.AppendLine("<th>");
sb.AppendLine("Project Name");
sb.AppendLine("</th>");
sb.AppendLine("<th>");
sb.AppendLine("Department");
sb.AppendLine("</th>");
sb.AppendLine("<th>");
sb.AppendLine("Budget");
sb.AppendLine("</th></tr>");
sb.AppendLine("</thead>");
List<Project> oProjectSummaries = Projects.GetActive();
sb.AppendLine("<tbody>");
foreach (ProjectSummary oProjectSummary in oProjectSummaries)
{
sb.AppendLine("<tr>");
sb.AppendLine("<td nowrap>");
var projectId = oProjectSummary.ProjectNumber.Substring(2); //string awaw "P-"
projectId = projectId.TrimStart('0');
sb.AppendLine("<a href='../ProjectProfile.aspx?id=" + projectId + "' target='_blank'>" + oProjectSummary.ProjectNumber + "</a>");
}
sb.AppendLine("</td>");
sb.AppendLine("<td>");
sb.AppendLine(oProjectSummary.InternalReferenceNumber);
sb.AppendLine("</td>");
sb.AppendLine("<td>");
sb.AppendLine(oProjectSummary.ProjectName);
sb.AppendLine("</td>");
sb.AppendLine("<td>");
sb.AppendLine(oProjectSummary.AbbreviationText);
sb.AppendLine("</td>");
sb.AppendLine("<td nowrap align='right' style='padding-right:15px;'>");
sb.AppendLine(oProjectSummary.FormattedContribution);
sb.AppendLine("</td>");
sb.AppendLine("</tr>");
}
sb.AppendLine("</tbody>");
sb.AppendLine("</table>");
Response.Write(sb);