首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

EXTJS MVC 使用AjaxProxy与“api”配置选项来支持不同store Url的读取和修改,该如何处理

2012-03-05 
EXTJS MVC 使用AjaxProxy与“api”配置选项来支持不同store Url的读取和修改我用EXTJS4的mvc模式开发,现在要

EXTJS MVC 使用AjaxProxy与“api”配置选项来支持不同store Url的读取和修改
我用EXTJS4的mvc模式开发,现在要修改grid的某一行提交到后台,
可是出现这个错误:uncaught exception: You are using a ServerProxy but have not supplied it with a url.

JScript code
//store/Users.jsExt.define('ERP.store.Users', {    extend: 'Ext.data.Store',    model: 'ERP.model.User',    autoLoad: false,    pageSize: 15,    autoSync: true,    proxy: {        type: 'ajax',        api: {            read: '/User/Search',            update: '/User/SaveUser'        },        reader: {            type: 'json',            root: 'rows',            totalProperty: 'totalCount',            successProperty: 'success'        }    },    initComponent: function() {        this.callParent();    }    });//controller/User.jsExt.define('ERP.controller.User', {    extend: 'Ext.app.Controller',    stores: ['Users'],    models: ['User'],    views: ['user.Portal', 'user.List', 'user.Edit'],    init: function() {        // console.log('Initialized User! This happens before the Application launch function is called');        this.control({            'userlist': {                itemdblclick: this.editUser            },            'useredit button[action=save]': {                click: this.updateUser            },            'userportal button[action=hello]': {                click: this.hello            }        });    },    editUser: function(grid, record) {        var view = Ext.widget('useredit');        view.down('form').loadRecord(record);    },    updateUser: function(button) {        console.log('Click the save button');              var win = button.up('window'),                    form = win.down('form'),                    record = form.getRecord(),                    values = form.getValues();               record.set(values);                this.getUsersStore().sync(); //这里应该跳到store的update:/User/SaveUser        //       // this.getStore('Users').sync();//同步                win.close();    },    hello: function(button) {        alert('hello');    }});

我在参考网站上看了,也没有成功。
<a href="http://www.sencha.com/forum/archive/index.php/t-131152.html?s=4a9332c6e5527165d7eea2c108beb981">参考地址</a>

[解决办法]
这个问题我爱莫能助~~我只能尽一下回帖的义务吧 ^_^
[解决办法]
你的update后面是个action吗?

热点排行