Data not being posted to server

1 posts, 0 answers
  1. Daniel
    Daniel avatar
    36 posts
    Member since:
    Apr 2009

    Posted 20 Sep 2012 Link to this post

    I can't seem to get any data from the server in the request.parts after specifying method="Post"  and
    contenttype="multipart/form-data"

    <html>
        <head>
            <title></title>
            <script src="js/lib/jquery/jquery-1.8.1.min.js"></script>
            <script src="js/lib/kendoui/kendo.web.min.js"></script>
            <link href="css/KendoUI/kendo.common.css" rel="stylesheet" />
            <link href="css/KendoUI/kendo.blueopal.css" rel="stylesheet" />
        </head>
        <body>
            <div id="example" class="k-content">
                <div id="grid"></div>
     
                <script>
                    $(document).ready(function() {
                        var crudServiceBaseUrl = "http://127.0.0.1:8081/cors", dataSource = new kendo.data.DataSource({
                            transport : {
                                read : {
                                    url : crudServiceBaseUrl + "/People",
                                    dataType : "json"
                                },
                                update : {
                                    contentType: "multipart/form-data",
                                    type: "POST",
                                    url : crudServiceBaseUrl + "/People/?$method=update",
                                    dataType : "json",
                                     data: {
                                            __KEY: 26,
                                            __STAMP: 23,
                                            ID: 26,
                                            firstName: "fgsdf44",
                                            lastName: "dsdfgdfg"
                                            }
                                },
                                destroy : {
                                    url : crudServiceBaseUrl + "/People(28)/?$method=delete",
                                    dataType : "json"
                                },
                                create : {
                                    url : crudServiceBaseUrl + "/People/Create",
                                    dataType : "json"
                                },
                                parameterMap : function(options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return {
                                            models : kendo.stringify(options.models)
                                        };
                                    }
                                }
                            },
                            schema : {
                                data : "__ENTITIES",
                                model : {
                                    id : "ID",
                                    fields : {
                                        __KEY : {
                                            editable : false,
                                            nullable : true
                                        },
                                        __STAMP : {
                                            editable : false,
                                            nullable : true
                                        },
                                        ID : {
                                            editable : false,
                                            nullable : true
                                        },
                                        firstName : {
                                            validation : {
                                                required : true
                                            }
                                        },
                                        lastName : {
                                            validation : {
                                                required : true
                                            }
                                        }
                                    }
                                }
                            }
                        });
     
                        $("#grid").kendoGrid({
                            dataSource : dataSource,
                            pageable : true,
                            height : 400,
                            toolbar : ["create"],
                            columns : ["__KEY", "__STAMP", "ID", "firstName", "lastName", {
                                command : ["edit", "destroy"],
                                title : " ",
                                width : "210px"
                            }],
                            editable : "inline"
                        });
                    });
                </script>
            </div>
     
        </body>
    </html>

Back to Top