Results 1 to 2 of 2

Thread: Pass a parameter to a store's read method while using autoLoad

  1. #1
    Sencha User
    Join Date
    Jan 2017
    Posts
    10

    Default Pass a parameter to a store's read method while using autoLoad

    I'm a novice with extjs. I have a ViewModel which autoLoads a store. However, I need to pass a parameter to my Read method in the store's api. How would I go about doing that in the below scenario? I tried to put paramOrder on the proxy but that didn't work.

    ViewModel:
    Code:
    Ext.define('Rsvp.Web.grid.DelegateViewModel', {
        extend: 'Ext.app.ViewModel',
        alias: 'viewmodel.delegate',
    
        stores: {
            delegateStore: {
                type: 'delegateList',
                autoLoad: true,
            }
        }
    });
    Store:
    Code:
    Ext.define('Rsvp.Web.store.DelegateList', {    extend: 'Ext.data.Store',
        storeId: 'delegates',
        requires: [
                'Rsvp.Web.model.Delegate'
        ],
        model: 'Rsvp.Web.model.Delegate',
        alias: 'store.delegateList',
        proxy: {
            api: {
                read: 'Direct.SessionOrganizer.GetDelegatesBySession',
                create: 'Direct.SessionOrganizer.InsertDelegate',
                destroy: 'Direct.SessionOrganizer.RemoveDelegate'
            },
            writer: {
                writeAllFields: true,
                encode: false
            }
        }
    });

  2. #2
    Sencha Premium User danguba's Avatar
    Join Date
    Feb 2009
    Location
    Kragujevac, Serbia
    Posts
    462
    All Best
    ---
    Željko Mitrović
    http://skitanja.blogspot.com/

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." Martin Golding

Similar Threads

  1. Pass parameter to dataview Store
    By geniodella in forum Community Discussion
    Replies: 4
    Last Post: 30 Apr 2012, 1:05 PM
  2. Extjs 3 and DwrProxy, how can i pass parameters to read method?
    By paoloyx in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 29 Mar 2010, 1:04 AM
  3. [Solved] Store Parameter pass
    By michaelc in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 17 Apr 2008, 1:53 PM

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
  •