【发布时间】:2014-03-12 21:21:46
【问题描述】:
我正在尝试将 kendo 数据源中的字符串传递到网格中的模板中,该模板充当打印按钮。该按钮会触发一个函数,该函数会打开一个指向报表服务器的新链接,我需要将一个字符串值传递给该函数,以便该字符串值随后在 url 中发送。
如果我发送数据源 Id 字段,我可以正常工作,但如果我尝试发送字符串值(医师),我会收到“意外标识符”错误。我尝试将列:字段:更改为医师,但得到相同的错误。
编辑:我可以传递任何 int 值,但如果我尝试发送字符串,它会中断。
如何将 Id 以外的值传递给我的模板?
schema: {
model: {
id: "Id",
fields: {
"ClinicName": { type: "string" },
"Physician": { type: "string" },
"Phone": { type: "string" },
"Fax": { type: "string" },
"Specialty": { type: "string" },
"Consent": { type: "date" }
}
}
},
pageSize: 10
});
function printForm(Physician) {
var stuid = $('#sisid').html().match(/\d+/);
var user = $('#user').val();
var sid = $('#sess').val();
window.open("http://@reportServer/ReportServer/Pages/ReportViewer.aspx?/SHPN/Treatment%20Form&rs:Command=Render&StudentId=" + stuid + "&SessionId=" + sid + "&CurrentUser=" + user + "&Physician=" + Physician);
};
$(document).ready(function () {
columns: [
{
field: "Id",
width: "38px",
title: "Print",
filterable: false,
sortable: false,
template: "<a class='change-image' href='javascript:void(0);' title='Print Treatment Form' onclick='printForm(#= Id #)'><img alt='Student Info' src='@Url.Content("~/Content/Images/printer-icon.png")' /></a>"
},
【问题讨论】:
标签: kendo-ui kendo-grid