0

请参阅下面的 AJAX done 函数中的注释:

$("<div/>").appendTo(e.detailCell).kendoGrid({
        reorderable: true,
        resizable: true,
        dataSource: {
            transport: {
                read: function()
                {
                    $.ajax({
                        url: "http://x/y/api/Awards/directors/" + e.data.AwardTitleId,
                        type: "GET"
                    }).done(function()
                    {
                        //I'm not sure what to do here in order to bind the data returned by the GET to the grid.
                    });
                },
            },
            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: "&nbsp;", width: 100 }],
        sortable: true,
        sort: { field: "namefirstlast", dir: "desc" },
        editable: "inline",
        toolbar: [{ name: "create", text: "Add New Director/Recipient" }]
    });
4

1 回答 1

0

弄清楚了:

detailRow.find(".directorsOrRecipients").data("kendoGrid").dataSource.read();
detailRow.find(".directorsOrRecipients").data("kendoGrid").refresh();
于 2013-09-12T00:25:07.577 回答