我有一个绑定到 iggrid 的数据源,其中语句列数据返回链接
a href=E:\FILES\STATEMENTS\DAILYSTATEMENTS\20150127\R-956-10103.pdf
代码如下
$(function () {
var data = <%= GetAccountInformationJSON() %>;
if ( data != '' )
{
$("#gridAccountInformation").igGrid({
height: ((content_height - HeaderHeight) / 2) +"px",
width: "100%",
columns: [
{headerText: "Account", key:"Account", dataType: "string"},
{headerText: "Office", key:"Office", dataType: "string"},
{headerText: "Balance", key:"Balance", dataType: "number", format: "0#,###"},
{headerText: "Init Mrg", key:"InitMarginReq", dataType: "number", format: "0#,###"},
{headerText: "OTE", key:"OpenTrdEqty", dataType: "number", format: "0#,###"},
{headerText: "Total Eqty", key:"TotalEqty", dataType: "number", format: "0#,###"},
{headerText: "Liq. Val", key:"LiquidatingVal", dataType: "number", format: "0#,###"},
{headerText: "Ex/Def", key:"ExcessDeficit", dataType: "number", format: "0#,###"},
{headerText: "Statement", key:"Statement", dataType: "string"}
]
,
features:[
{
name: "Resizing",
}
],
dataRendered: function (evt, ui) {
ui.owner.element.find("tr th:nth-child(1)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(2)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(3)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(4)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(5)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(6)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(7)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(8)").css("text-align", "center");
ui.owner.element.find("tr th:nth-child(9)").css("text-align", "center");
}
,
dataSource: data //JSON Array defined above
});
$("#gridAccountInformation").igGrid("option", "datasource", data);
}
});
在上面的 iggrid 中,Stmt 将显示为链接。单击它时,我需要下载数据源中存在的文件。
例如:a href=E:\FILES\STATEMENTS\DAILYSTATEMENTS\20150127\R-956-10103.pdf
点击上面应该下载文件 R-956-10103.pdf
任何帮助将不胜感激