Results 1 to 9 of 9

Thread: How to set the AjaxProxy to read xml by http postmethod

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    78
    Vote Rating
    3
      0  

    Default 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 User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      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

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2009
    Posts
    78
    Vote Rating
    3
      0  

    Default 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 User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Yes
    Aaron Conran
    @aconran

  5. #5
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Rome Italy
    Posts
    17
    Vote Rating
    1
      0  

    Default 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 User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Did you add the custom property?
    Aaron Conran
    @aconran

  7. #7
    Sencha Premium Member
    Join Date
    May 2013
    Location
    Rome Italy
    Posts
    17
    Vote Rating
    1
      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
    78
    Vote Rating
    3
      0  

    Default 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
      0  

    Default 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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •