Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Vote Rating
    anthonykulis is on a distinguished road


    Default Using direct proxy with extraParams

    This seems like it should be really simple, so I think I am just missing something obvious. When using a direct proxy we can set our read op to use extraParams but what I want to know is can we send extraParams using the create, update, and destroy calls?

            Ext.define('Behave.models.ReportCategory', {
                extend: '',
                fields: [
                    {name: 'id', mapping: 'BEHAVE-REPORT-CATEGORY_id'},
                    {name: 'text', mapping: 'BEHAVE-REPORT-CATEGORY_text'},
                    {name: 'description', mapping: 'BEHAVE-REPORT-CATEGORY_description'}
                proxy: {
                    type: 'direct',
                    api: {
                        create: Behave.ReportController.tempCatchAll,
                        read: Behave.ReportCategoryController.getCategories,
                        update: Behave.ReportController.tempCatchAll
                    extraParams: {
                        sessionpwd: kms.getTokenizedKey()
                    reader: {
                        type: 'json',
                        root: 'data'
                    simpleSortMode: true
    The above will execute the read with the sessionpwd property but will not for any other op. How can I do this when my store autoSyncs?

        var categoryStore = Ext.create('', {
            model: 'Behave.models.ReportCategory',
            sorters: [{property: 'BEHAVE-REPORT-CATEGORY_text', direction: 'ASC'}],
            autoLoad: true,
            autoSync: true
    Last edited by anthonykulis; 26 Jul 2011 at 5:32 AM. Reason: code tags