使用extjs无法成功更新多个记录(500错误)

时间:2013-08-12 22:33:41

标签: extjs

应用程序是使用extjs 4和ext scheduler开发的。 我想选择一些记录并更新这些记录,记录会更新,但会发布许多更新请求(我使用json)。

例如,我想编辑两条记录,发布两个要更新的POST请求,第一个获取状态200,另一个获得状态500(内部服务器错误)。 第一个帖子的大小比最后一个小(1.9 KB,在这种情况下为9.2 KB)

onSaveClick: function () {
var selectedEvents = grids.scheduler.getEventSelectionModel().getSelection();


            stores.eventStore.suspendAutoSync();
            for (var i = 0; i < selectedEvents.length; i++) {
                selectedEvents[i].set({
                    CustomerId: variables.customerField.getValue(),
                    CustomerName: variables.customerField.getRawValue(),
                    Notes: variables.hideFieldsField.getComponent('Notes').getValue(),
                    Scope: variables.scopeField.getValue().Scope,
                    Preliminary: variables.preliminaryBox.getValue(),
                    WorkWeekends: variables.weekendsField.getValue()
                });

            stores.eventStore.resumeAutoSync();
            stores.eventStore.sync();
},

1 个答案:

答案 0 :(得分:0)

看起来我通过添加selectedEvents [i] .commit();

解决了这个问题