This is a migrated thread and some comments may be shown as answers.
could not edit
2 Answers 90 Views
This is a migrated thread and some comments may be shown as answers.
Yuan
Top achievements
Rank 1
Yuan asked on 27 Apr 2012, 08:39 PM
this code is part of my last project,it can be execute right.
$(document)
            .ready(
                    function() {
                        var dataSource = new kendo.data.DataSource(
                                {
                                    transport : {
                                        read : {
                                            url : "${pageContext.request.contextPath}/queryAllBusLineServlet",
                                            dataType : "json"
                                        },
                                        update : {
                                            url : "${pageContext.request.contextPath}/updateBusLineServlet"
                                        }
                                    },
                                    batch : true,
                                    schema : {
                                        model : {
                                            id : "id",
                                            fields : {
                                                id : {
                                                    editable : false
                                                },
                                                name : {
                                                    editable : true
                                                }
                                            }
                                        }
                                    }
                                });
                        $("#grid").kendoGrid( {
                            sortable : true,
                            dataSource : dataSource,
                            pageable : true,
                            height : 600,
                            columns : [ {
                                field : "id",
                                title : "id",
                                editable : false
                            }, {
                                field : "name",
                                title : "name"
                            }, {
                                command : [ "edit" ]
                            } ],
                            editable : "popup"
                        });
                    });

in next project ,i write like that,
var url = "${pageContext.request.contextPath}/querySamplesServlet?status="
                + status;
        var dataSource = new kendo.data.DataSource(
                {
                    transport : {
                        read : {
                            url : url,
                            dataType : "json"
                        },
                        update : {
                            url : "${pageContext.request.contextPath}/updateSampleServlet"
                        }
                    },
                    batch : true,
                    schema : {
                        model : {
                            id : "id",
                            fields : {
                                id : {
                                    editable : false
                                },
                                name : {
                                    editable : false
                                },
                                status : {
                                    editable : true
                                }
                            }
                        }
                    }
                });
        $("#samples").kendoGrid( {
            sortable : true,
            dataSource : dataSource,
            pageable : true,
            height : 600,
            columns : [ {
                field : "id",
                title : "id",
                editable : false
            }, {
                field : "name",
                title : "name",
                editable : false
            }, {
                field : "status",
                title : "status"
            }, {
                command : [ "edit" ]
            } ],
            editable : "popup"
        });

here is the problem,it has no error or warning in chrome console,but the edit button shows "undefined",and while i edit status,it just doesn't work,no data send to server.

2 Answers, 1 is accepted

Sort by
0
Yuan
Top achievements
Rank 1
answered on 27 Apr 2012, 09:04 PM
i copy the preview kendo js to current project,and redeploy project,but the chrome colsone says Uncaught TypeError: Cannot read property 'field' of undefined ,in kendo.all line 8
0
Chris Foster
Top achievements
Rank 1
answered on 01 May 2012, 12:58 PM
Tags
Grid
Asked by
Yuan
Top achievements
Rank 1
Answers by
Yuan
Top achievements
Rank 1
Chris Foster
Top achievements
Rank 1
Share this question
or