我試圖通過屬性值來選擇元素,因爲這樣的:
var item = jQuery("[name='directorSequence']");
但我不知道如何真正得到屬性"aria-valuenow="
的價值......在此案件是4.
任何人都可以幫我一把嗎?
編輯 -
這是代碼的其餘部分:
detailRow.find(".directorsOrRecipients").kendoGrid({
reorderable: true,
resizable: true,
dataSource: {
transport: {
read: {
url: "http://z/x/api/Awards/directors/" + awardTitleId,
type: "GET"
},
},
schema: {
model: {
id: "AwardDirectorId",
fields: {
"AwardDirectorId": { editable: false, type: "number", nullable: true },
"namefirstlast": { editable: true, type: "string" },
"directorsequence": { editable: true, type: "number", validation: { min: 1 } },
"isonballot": { editable: true, type: "string" },
"concatenation": { editable: true, type: "string" },
"MoreNames": { editable: true, type: "number", validation: { min: 0 } },
}
}
}
},
columns: [
{ field: "AwardDirectorId", title: "Award Director Id", hidden: true },
{ field: "namefirstlast", title: "Name", editor: namesAutoComplete },
{ field: "directorsequence", title: "Director Sequence", format: "{0:n0}" },
{ field: "isonballot", title: "On ballot?", editor: onBallotDropDownEditor },
{ 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" }],
save: function(e)
{
debugger;
$(document).ready(function()
{
debugger;
var item = jQuery("[name='directorSequence']");
var x = item.attr("aria-valuenow");
});
$.ajax({
url: "http://localhost/Take3/api/awards/directors",
type: "POST",
dataType: "json",
data: $.parseJSON(directorData)
}).done(function()
{
detailRow.find(".directorsOrRecipients").data("kendoGrid").refresh();
});
},
edit: function()
{
}
});
風格顯示:無,挑選另一張照片。 –