Threaded View

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

      0  

    Default Using direct proxy with extraParams

    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?

    Example:
    Code:
            Ext.define('Behave.models.ReportCategory', {
    
                extend: 'Ext.data.Model',
    
                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?

    Code:
        var categoryStore = Ext.create('Ext.data.Store', {
    
            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