Extjs4 store addes get params in url

I am using extjs4 storage

Xhtpp calls display http://localhost/home_dir/index.php/questions/content_pie?_dc=1312366604831&hi=&page=1&start=0&limit=25

This is the store code.

    var content_type_store = new Ext.data.Store({
    proxy: new Ext.data.HttpProxy({
    url: BASE_URL+'questions/content_pie',
    method:'POST',
    params :{hi:''}

    }),
    reader: new Ext.data.JsonReader({
    root: 'results'
    }, [
    'qtype',
    'qval'
    ])
    });

Although I set the method as POST, its get parameters appear in url

I use codeigniter as my framework. I disabled the GET parameters in CI. Iwnat send options to message. with ext2 and 3, this code worked fine.

help me

thank

0
source share
1 answer

method:'POST'in the proxy configuration will not work. This configuration option is missing. However, there are two ways to make use of the store POST. The simpler is to simply override the function getMethod:

var content_type_store = new Ext.data.Store({
  proxy: {
    type: 'ajax',
    url: BASE_URL+'questions/content_pie',
    extraParams :{hi:''},
    // Here Magic comes
    getMethod: function(request){ return 'POST'; }

  },
  reader: {
    type: 'json',
    root: 'results'
  }
});

: actionMethods. , :

  // ...
  proxy: {
    type: 'ajax',
    url: BASE_URL+'questions/content_pie',
    extraParams :{hi:''},
    // Here Magic comes
    actionMethods: {
      create : 'POST',
      read   : 'POST',
      update : 'POST',
      destroy: 'POST'
    }
  },
  // ...
+2

All Articles