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

Grid popup editor doesn't update

1 Answer 213 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Valanto
Top achievements
Rank 1
Valanto asked on 30 Apr 2012, 10:49 AM
Hi,
I'm using the grid with the popup editor. All is well but when I click the update button the grid doesn't call the update url given to my datasource. I have the latest 2012.1.322 version of kendo. Is there a specific configuration I need to give to my grid for this to work?!!

        gridContainer
        .kendoGrid({
            dataSource : dataSource,
            pageable : false,
            height : 400,
            sortable : true,
            toolbar : [ "create" ],
                            columns : [
                    {
                        field : "firstName",
                        title : "First Name"
                    },
                    {
                        field : "lastName",
                        title : "Last Name"
                    },
                    {
                        field : "email",
                        title : "Email"
                    },
                    {
                        field : "status",
                        title : "Status",
                        editor : statusEditor
                    },
                    {
                        field : "telephone",
                        title : "Telephone"
                    },
                    {
                        field : "jobTitle",
                        title : "Job"
                    },
                    {
                        field : "newsSubscription",
                        title : "Subscribe to news?"
                    } ],
            editable : "popup"
        });
 
        var grid = gridContainer.data("kendoGrid");
    }
     
     
});
 
 
function createDataSource(readUrl, updateUrl, destroyUrl, createUrl){
    return new kendo.data.DataSource({
        transport : {
            read : {
                url : readUrl,
                dataType : "json"
            },
            update : {
                url : updateUrl,
                dataType : "json"
            },
            destroy : {
                url : destroyUrl,
                dataType : "json"
            },
            create : {
                url : createUrl,
                dataType : "json"
            },
            parameterMap : function(options, operation) {
                debugger;
                if (operation !== "read" && options.models) {
                    return {
                        models : kendo.stringify(options.models)
                    };
                }
            }
        },
        batch : true,
        pageSize : 30,
        schema : {
            model : {
                id : "id",
                fields : {
                    firstName : {
                        validation : {
                            required : true
                        }
                    },
                    lastName : {
                        validation : {
                            required : true
                        }
                    },
                    email : {
                        validation : {
                            required : true
                        }
                    },
                    telephone : {
                        validation : {
                            required : false
                        }
                    },
                    jobTitle : {
                        validation : {
                            required : false
                        }
                    },
                    newsSubscription : {
                        validation : {
                            required : false
                        },
                        type : "boolean"
                    },
                    status : {
                        validation : {
                            required : false
                        },
                        type : "text"
                    }
 
                }
            },
            data : function(data) {
                return data.users;
            }
        }
    });
}

Thank you,
Valanto

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 02 May 2012, 01:40 PM
Hello Valanto,

I am not able to determine what causes the issue from the code you provided. Could you please check the console for some JavaScript errors that might occur? If there are not any, could you please send a runnable project, that could be examined in details?


Kind regards,

Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Valanto
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or