0

KendoUIグリッドを使用してラインバッチ編集を行っています。変更が正常に保存されたら、ユーザーにメッセージを表示したいと思います。どうすればよいですか?

私のマークアップ:

<div id="employeeGoalsGrid"></div>

私のJavascript:

var goalsDataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: '/MVC/ResearcherPoints/GetEmployeeResearchers',
            type: 'POST',
            contentType: 'application/json'
        },
        update: {
            url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
            type: 'POST',
            contentType: 'application/json'
            //dataType: "jsonp"
        },
        parameterMap: function (options, type) {
            debugger;
            $.extend(options, { ID: options.id });
            return JSON.stringify(options);
        }
    },
    batch: false,
    schema: {
        model: {
            id: 'ID',
            fields: {
                id: { editable: false, nullable: false },
                FirstName: { editable: false, nullable: true  },
                LastName: { editable: false, nullable: true },
                Title: { editable: false, nullable: true },
                TeamName: { editable: false, nullable: true },
                PointsGoal: { type: "number", nullable: true, validation: { required: false, min: 1 } }
            }
        }
    },
    sortable: true,
    filterable: true,
    columnMenu: true
});


$('#employeeGoalsGrid').kendoGrid({
    dataSource: goalsDataSource,
    navigatable: true,
    sortable: true,
    resizable: true,
    toolbar: ["save", "cancel"],
    columns: [
        { field: "FirstName", title: "First Name", width: 200},
        { field: "LastName", title: "Last Name", width: 200 },
        { field: "Title", title: "Title", width: 200 },
        { field: "TeamName", title: "Team", width: 200 },
        { field: "PointsGoal", title: "Goal", width: 200 }],
    editable: true,
    filterable: true,
});
4

2 に答える 2

2

ロドニー、イベント全体を利用するのはどうですか。少し汚いですが、私は剣道のサクセスイベントをうまく機能させることができませんでした(誰かが剣道を成功させたかどうかはわかりませんか?)。

 update: {
            url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
            type: 'POST',
            contentType: 'application/json',
            complete: function (jqXhr, textStatus) {
                            if (textStatus == 'success') {
                                var result = jQuery.parseJSON(jqXhr.responseText);
                                // read your result   
                                // open your dialog
                            }
                    }
        },
于 2012-11-26T18:04:08.887 に答える
1

dataSourceの同期イベントを使用する必要があります。

var goalsDataSource = new kendo.data.DataSource({
    sync: function(e){
        alert('Synchronization has completed! Your changes are saved!')
    }
//...
于 2012-11-26T19:19:15.893 に答える