简体   繁体   English

Extjs4:使用方法POST的TreeStore

[英]Extjs4: TreeStore with method POST

I have a Ext.tree.Panel and define in it I have a store . 我有一个Ext.tree.Panel并在其中定义我有一个store I want to be able to update the store via ajax along with POST params. 我希望能够通过ajax和POST参数更新商店。

Here is my tree definition: 这是我的树定义:

var mytree = Ext.create('Ext.tree.Panel',{
    rootVisible:false,
    store:Ext.create('Ext.data.TreeStore', {        
        root:{
            id:'rootnode',
            nodeType:'async'         
        },
        proxy:{
            method:'post',
            type:'ajax',            
            url:'myurl'
        }
    })    
});

And I try and reload the store as follows: 我尝试按如下方式重新加载商店:

mytree.store.load({params:{search_string='value'}})

But the store attempts to reload with the params as GET Parameters. 但商店尝试使用params作为GET参数重新加载。

Some help would be greatly appreciated. 一些帮助将不胜感激。 The ExtJS 4 Docs arent great at the moment (in my opinion) ExtJS 4 Docs目前还不是很棒(在我看来)

There is actionMethods parameter in proxy to specify method of requests: http://dev.sencha.com/deploy/ext-4.0.0/docs/api/Ext.data.proxy.Ajax.html 代理中有actionMethods参数来指定请求的方法: http ://dev.sencha.com/deploy/ext-4.0.0/docs/api/Ext.data.proxy.Ajax.html

proxy:{
    actionMethods: {
        create: 'POST',
        destroy: 'DELETE',
        read: 'POST',
        update: 'POST'
    },
    type:'ajax',            
    url:'myurl'
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM