proxy里的method根本不管用,而且我在API里也找不到method这个配置项
我用的是extjs4,求解 Ext.define("dfl", {
extend: "Ext.data.Model",
fields: [
{name: "dflDm", type: "string"},
{name: "dflMc", type: "string"}
]
});
Ext.create("Ext.form.field.ComboBox", {
renderTo: Ext.getBody(),
store: {
model: "dfl",
proxy: {
url: "http://localhost/yx/dflServlet",
method: "post",
type: "ajax"
}
},
displayField: "dflMc",
valueField: "dflDm"
})

解决方案 »

  1.   

    想知道你出现了什么问题、ajax请求应该都是post请求啊~~!
      

  2.   

    就是因为他用了get来请求,所以我才去找post请求的方式,可是找不到method这个配置项
      

  3.   

     关于post还是get 这个真得看源码怎么封装的 
      

  4.   


    actionMethods: { read: 'POST' },//将提交方式改为post,试试看
      

  5.   


    var store = Ext.create('Ext.data.Store', {
                model : 'MyModel',
                autoLoad : true,
                proxy : {
                    type : 'ajax',
                    url : 'template/list_template.do',
                    actionMethods: { read: 'POST' },//将提交方式改为post
                    reader : {
                        type : 'json',
                        root : 'data'
                    }
                }
            });
      

  6.   


    我无语掉了,找完了proxy包下的所有类,都没见一个有actionMethods的配置项的,不过确实可以用
    文档问题还是什么?受不了
      

  7.   


    Ext.create("Ext.form.field.ComboBox", {
                        renderTo: Ext.getBody(),
                        store: {
                            model: "dfl",
                            autoLoad: true,//加这一句
                            proxy: {
                                url: "http://localhost/yx/dflServlet",
                                //method: "post",这句不要了
                                type: "ajax"
                            }
                        },
                        displayField: "dflMc",
                        valueField: "dflDm"
                    })
      

  8.   


    你在API里面直接搜索actionMethods就可以找到了