This is a migrated thread and some comments may be shown as answers.

Empty POST fields when transport create

2 Answers 103 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Marta
Top achievements
Rank 1
Marta asked on 24 Nov 2012, 06:20 PM
Hello. When I add a record in my Grid, "create" url is hit using POST, but checking in the httpd logs, POST parameters are empty.
This is my Grid & Datasource definition:

$(function() {
                $("#grid").kendoGrid({
                    dataSource: {
                        transport:{
                            read:"libyMsg.php?way=getUsrMsgList",
                            create:{
                                url :"libyMsg.php?way=createMsg",
                                type:"POST"
                            },
                            update:{
                                url :"libyMsg.php?way=updateeMsg",
                                type:"POST"
                            },
                            destroy:{
                                url :"libyMsg.php?way=destroyMsg",
                                type:"POST"
                            }
                        },
                        batch: true,
                        pageSize: 10,
                        schema: {
                            data: "data",
                            model: {
                                id: "msg_id",
                                fields: {
                                    msg_id: { editable: false, nullable: true },
                                    msg_title: { validation: { required: true } },
                                    msg_content: {  validation: { required: true } },
                                    msg_type: { type: "number", validation: { min: 0, required: true }},
                                    msg_date: { type: "date", validation: { required: true } },
                                    msg_status: { type: "number", validation: { min: 0, required: true } }
                                }
                            }
                        }
                    },
                    columns: [{ field: "msg_id", width: 40,title: "ID" },
                        { field: "msg_title",width: 230, title: "Title" },
                        { field: "msg_content", width: 370,title: "Content" },
                        { field: "msg_type", width: 40,title: "Type" },
                        { field: "msg_date", width: 300,title: "Date" },
                        { field: "msg_status", width: 40,title: "Status" }],
                    scrollable: true,
                    sortable: true,
                    editable:"popup",
                    pageable: {
                        refresh: true,
                        pageSizes: true
                    },
                    toolbar: ["create", "save", "cancel"],
                });
            });
             
                         
        </script>
I wonder why im receiving an empty POST.
Thanx,
M

2 Answers, 1 is accepted

Sort by
0
Samir
Top achievements
Rank 1
answered on 27 Nov 2012, 08:54 AM
Hi,

Yeah, I am also facing same issue.
Please help me to fix the issue.

Any help will be appreciable.

Thanks,

0
Marta
Top achievements
Rank 1
answered on 27 Nov 2012, 11:16 AM
Samir, Ive learned that if you have the option "batch: true", POST parameters comes into an array.
In PHP should be something like this:
batch:true    models[0][id]  into $_POST
batch:false  $_POST['id'];

Hope this helps.
M
Tags
Data Source
Asked by
Marta
Top achievements
Rank 1
Answers by
Samir
Top achievements
Rank 1
Marta
Top achievements
Rank 1
Share this question
or