문제

Kendoui 그리드를 사용하여 일부 데이터를 표시합니다.JayData를 사용하여 CRUD 작업을 단순화합니다.

행에서 한 항목을 편집 한 다음 업데이트를 클릭하면 게시물 대신 병합 동사를 보냅니다.

지금, 병합 대신 게시물을 보내고 싶습니다.

JayData는 병합 및 패치 대신 풋과 게시물을 보내려면 어떻게합니까?

나는 그것이 중요하지 않다고 생각하지만, 아래의 코드는 다음과 같습니다.

var baseAssetMgmtURL = "http://localhost/AssetManagementAPI/odata/";
var crudServiceComputerBaseURL = baseAssetMgmtURL + "Computers/";

var computer = $data.define("computer", {
   ComputerId: { type: Number, key: true },
   AssetTag: Number,
   BrandModel: String,
   ComputerModelTypeId: Number,
   ComputerTypeId: Number,
   ComputerType: String,
   PurchaseDate: Date,
   OperatingSystemTypeId: Number,
   OperatingSystemType: String,
   ComputerName: String,
   Notes: String,
   MHIPSConnection: Date,
   RetiredDate: Date
});

var ds = computer.asKendoDataSource({
   provider: 'oData',
   url: crudServiceComputerBaseURL,
   batch: false,
   pageSize: 10,
   serverPaging: false
   //,
   //transport: { update: { type: "POST" } }
});

var setGrid = function () {
$("#grid").kendoGrid({
    dataSource: ds,
    columns: [
        { title: "AssetTag", field: "AssetTag", filterable: false },
        {
            title: "Brand Type", field: "ComputerModelTypeId", filterable: false,
            editor: brandTypeDropDownEditor, template: "#= getModelType(ComputerModelTypeId) #"
        },
        {
            title: "Computer Type", field: "ComputerTypeId", filterable: false,
            editor: computerTypeDropDownEditor, template: "#= getComputerType(ComputerTypeId) #"
        },
        { title: "PurchaseDate", field: "PurchaseDate", filterable: false },
        {
            title: "OS Type", field: "OperatingSystemTypeId", filterable: false,
            editor: osTypeDropDownEditor, template: "#= getOSType(OperatingSystemTypeId) #"
        },
        { title: "Name", field: "ComputerName", filterable: false },
        { title: "Notes", field: "Notes", filterable: false },
        { title: "MHIPSConnection", field: "MHIPSConnection", filterable: false },
        { title: "Retired", field: "RetiredDate", filterable: false },
        { command: ["edit"], title: " " }
    ],
    pageable: true,
    sortable: false,
    scrollable: false,
    editable: "inline",
    toolbar: ["create"]
});
.

};

도움이 되었습니까?

해결책

HTTP 동사를 넣으려면 HTTP 동사를 다시 작성할 수 있지만 요청 본문은 여전히 병합 요청이 될 것입니다. 여기에 다시 작성하는 것에 대한 예제를 찾을 수 있습니다. https://github.com/jaydata/jaydata/issues/111

휴식을 원한다면 WebApi 공급자를 사용하십시오

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top