保存时extjs ServerProxy错误

Mar*_*iry 4 javascript rest extjs

我正在尝试从网格行图标更新字段值.但我得到这个错误:

Uncaught Ext.data.proxy.Server.buildUrl(): You are using a ServerProxy but have not supplied it with a url.

我正在使用RestProxy,这是商店定义:

Ext.define('SF.store.Contents', {

    requires: [
        'SF.Config',
        'SF.store.RestProxy'
    ],

    extend: 'Ext.data.Store',
    model: 'SF.model.Content',
    autoLoad: false,

    proxy: Ext.create('SF.store.RestProxy', {
        url: (new SF.Config()).getApiBaseUrl() + "admin/contents"
    }),

});
Run Code Online (Sandbox Code Playgroud)

GridPanel定义上的列代码

....
 store: 'Contents',    
.....
{ xtype: 'actioncolumn', header: 'Action'
 , width: 40
 , items: [{ // Delete button
        icon: '......./cancel.png'
        , handler: function(grid, rowIndex, colindex) {
            var record = grid.getStore().getAt(rowIndex);
                record.set('status',6);

            record.save(); //THIS CALL THROWS THE ERROR

            grid.store.remove(record);
        } 
    },......
Run Code Online (Sandbox Code Playgroud)

此外,代理服务器正在为GET请求正常工作.有谁知道我应该在代理上定义什么?我已经阅读了官方文档,但对我来说并不清楚.

lon*_*ero 8

您必须为您的模型提供代理.在按钮的处理程序中,您调用模型的save方法(SF.model.Content),然后,您的SF.model.Content模型必须提供代理.