1

次のように、属性値で要素を選択しようとしました。

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()
    {
    }
});
4

2 に答える 2