日期:2014-05-16  浏览次数:20566 次

exjt的Ext.data.HttpProxy可以用params向后台发送参数吗
前台代码:

                        var requestConfig = new Ext.data.HttpProxy({
                            url: "/WebService/test/tb_data.ashx",
                            method: 'POST',
                            params: { userName: 'tom', password: '123' }, //请求参数
                            customer: '自定义属性', //附加属性
                            reader: new Ext.data.JsonReader({ totalProperty: "results", root: "data" })////reader配置是proxy的,不是store的
                        });

                        var store = new Ext.data.JsonStore({
                            proxy: requestConfig,
                            fields: [{ name: 'user_id' }, { name: 'user_name' }, { name: 'ssyj', type: "float"}],
                            listeners: {
                                load: function () {
                                    alert(store.getCount());
                                }
                            }
                        });
后台接收不到params传递的参数.
------解决方案--------------------
参数信息是store的config不是proxy的config
所以在jsonstore里
baseParams : Object

An object containing properties which are to be sent as parameters for every HTTP request.

Parameters are encoded as standard HTTP&nbs