1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    73
    Vote Rating
    1
    koujiid is on a distinguished road

      0  

    Default How to set the AjaxProxy to read xml by http postmethod

    How to set the AjaxProxy to read xml by http postmethod


    Hi
    I use the Sencha Architect 2.1.
    I want to use ajaxproxy to read the xml by http post method.
    AjaxProxy uses the http get method to read.
    Please tell me how to change this method in Sencha Architect 2.1.

    Thank you.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,087
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Sounds like you want an XmlStore (an XML reader coupled with an Ajax Proxy).

    The default behavior of what uses POST or GET is documented here:
    http://docs.sencha.com/ext-js/4-1/#!...-actionMethods

    Code:
    actionMethods: {read: 'POST'}
    should do you
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    73
    Vote Rating
    1
    koujiid is on a distinguished road

      0  

    Default Custom Property?

    Custom Property?


    Thank you your reply , aconran.

    I knew that in architect , I can add the property as custom prpperty.
    So, I added the "actionMethods" as a custom property.

    Is this right way?

    And I want to post the parameter. This way is right?

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,087
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Yes
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Rome Italy
    Posts
    17
    Vote Rating
    1
    r.colagrande is on a distinguished road

      0  

    Default the issue persists

    the issue persists


    I have the same problem with json... but it does not change.


    I work with SA Version: 2.2.2 Build: 991 and I have to modify the store.js after publishing...


    Question: How do I set actionMethods property with value read: 'POST'
    Answer: It is not possible.


    If I set:
    filters property as like as:
    filters: { exactMatch: true, property: 'actionMethods', value: {read: 'POST'}


    it does not work.


    store definition...
    Ext.define('MyProject.store.MyStore', {
    extend: 'Ext.data.Store',


    config: {
    storeId: 'MyStore',
    proxy: {
    type: 'ajax',
    headers: {
    'Content-Type': 'application/json; charset=utf-8'
    },
    reader: {
    type: 'json',
    idProperty: 'tk',
    rootProperty: 'records'
    }
    },
    ...

    RELOAD STORE snippet

    var store = Ext.StoreManager.lookup('MyStore'),
    store.getProxy().setUrl(myurl);


    storeC.load(
    {
    params:"{datefrom: '2013-06-01 00:00:00', dateto: '2013-06-01 23:59:59'}", scope:this,
    callback: function(records, operation, success){
    if(success){
    console.log('OK!');
    } else {
    console.log('Error!');
    }
    }
    });

    I have to specify manually this:
    config: {
    storeId: 'MyStore',
    proxy: {
    type: 'ajax',
    actionMethods: {
    read: 'POST'
    },
    headers: {
    'Content-Type': 'application/json; charset=utf-8'
    },
    reader: {
    type: 'json',
    idProperty: 'tk',
    rootProperty: 'records'
    }
    },


    This just solved my problem.


    Any suggest about SA handicap?

    aconran, could you be more precise, please?
    kind regards
    Raimondo Colagrande

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,087
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Did you add the custom property?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  7. #7
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Rome Italy
    Posts
    17
    Vote Rating
    1
    r.colagrande is on a distinguished road

      0  

    Default


    I have to specify actionMethods manually like this:
    config: {
    storeId: 'MyStore',
    proxy: {
    type: 'ajax',
    actionMethods: {
    read: 'POST'
    },
    headers: {
    'Content-Type': 'application/json; charset=utf-8'
    },
    reader: {
    type: 'json',
    idProperty: 'key',
    rootProperty: 'records'
    }
    }

    How do I set
    actionMethods by SA?

    Thanks

  8. #8
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    73
    Vote Rating
    1
    koujiid is on a distinguished road

      0  

    Default I could set the actionMethods by custom property.

    I could set the actionMethods by custom property.


    Hi,
    I could set the actionMethods in the xmlproxy code by using with custom property added by object type.

    Thank you.

  9. #9
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Rome Italy
    Posts
    17
    Vote Rating
    1
    r.colagrande is on a distinguished road

      0  

    Default sorry

    sorry


    I'm newbi and I didn't know how I can add a custom property.
    This post "http://www.sencha.com/forum/showthre...th-custom-type" helps me to understand it.

    Thanks

    and I'm sorry if you spent time for this trivial problem.

    Ray