如何从Store.sync()上的服务器获取响应消息

s.w*_*dit 1 json extjs

我有一个商店,我想sync()与服务器.

Store.sync()方法具有successfailure属性的功能,它们具有Ext.data.Batchoptions作为参数.

如果我从服务器得到这样的响应:

{
  success: false,
  msg: "test error!"
}
Run Code Online (Sandbox Code Playgroud)

failure 方法调用.

如何msgfailure方法中访问响应属性?

Vla*_*lad 5

    store.sync({
        failure: function(batch, options) {
            alert(batch.proxy.getReader().jsonData.msg);
        }
    });
Run Code Online (Sandbox Code Playgroud)