我需要捕获用户在以下字段中输入的值:
- isOnBallot
- 连接字符串
下面代码中的注释显示了我想在哪里使用这些变量。
我这里唯一不知道怎么做的是如何在这两个字段中引用VALUE。我不知道是否有一种特定的方式我应该用 Kendo 或尝试使用 jquery 来做到这一点。
例如,如果我检查元素 concatenationString,这就是我所看到的:
<input type="text" class="k-input k-textbox" name="concatenation" data-bind="value:concatenation">
这是网格定义:
function directorsOrRecipients(e)
{
$("<div/>").appendTo(e.detailCell).kendoGrid({
reorderable: true,
resizable: true,
dataSource: {
transport: {
read: {
url: "http://localhost/x/api/Awards/directors/" + e.data.AwardTitleId,
type: "GET"
},
create: {
url: "http://localhost/x/api/awards/directors",
type: "POST",
data: {
awardTitleId: e.data.AwardTitleId,
personId: localStorage.personId,
nameId: localStorage.nameId,
isOnBallot: "True",//I need to get this value based on the user input.,
concatenationString: "test1",//I need to get this value based on the user input.
whoEntered: 0
}
}
},
schema: {
model: {
id: "namefirstlast",
fields: {
"namefirstlast": { editable: true, type: "string" },
"directorsequence": { editable: true, type: "number", validation: { min: 1 } },
"isonballot": { editable: true, type: "boolean" },
"concatenation": { editable: true, type: "string" },
"MoreNames": {
editable: true,
type: "number",
validation: { min: 0 }
},
},
},
}
},
columns: [
{ field: "namefirstlast", title: "Name", editor: namesAutoComplete },
{ field: "directorsequence", title: "Director Sequence", format: "{0:n0}" },
{ field: "isonballot", title: "On ballot?" },
{ field: "concatenation", title: "Concatenation" },
{ field: "MoreNames", title: "More names?", format: "{0:n0}" },
{ command: ["edit"], title: " ", width: 100 }],
sortable: true,
sort: { field: "namefirstlast", dir: "desc" },
editable: "inline",
toolbar: [{
name: "create",
text: "Add New Director/Recipient"
}]
});
}
任何人都可以帮我一把吗?
谢谢!