Thursday, August 9, 2012

ExtJS 4: Force POST request in forms


To force post request in form, you have to specify the following property in the proxy:

    actionMethods: {
        create : 'POST' ,
        read   : 'POST' ,
        update : 'POST' ,
        destroy: 'POST'
    }

If you want apply this to all your models/stores, you can create your own proxy:

Ext.define( "My.data.AjaxProxy",{
      extend: "Ext.data.proxy.Ajax" ,
      alias: "proxy.myAjaxProxy" ,
      actionMethods: "POST" ,
});

An using it in your model/store:

proxy: {
      type: "myAjaxProxy" ,
      ...
}

No comments: