Results 1 to 3 of 3

Thread: New base class for stores

  1. #1
    Sencha Premium Member zmagyar's Avatar
    Join Date
    Mar 2012
    Location
    Budapest
    Posts
    94
    Vote Rating
    2
      0  

    Default New base class for stores

    I would like to add a listener to several stores in my application. Instead of defining the listener for each stores it would be more elegant to define a new store class where the listeners defined and use that class as the base class of my stores. I.e. instead of having

    Code:
    Ext.define('MyApp.store.offlineCustomer', {
        extend: 'Ext.data.Store',
    I would like to have

    Code:
    Ext.define('MyApp.store.offlineCustomer', {
        extend: 'Ext.data.MyStore',
    where MyStore is the class where the shared listeners are defined.

    Is there any way to implement it in Architect? Or the only one solution is to add the listeners to each class individually?

  2. #2
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    548
    Vote Rating
    44
      0  

    Default

    at some point I would like to do the same thing. in my case, i want a listener to intercept all ajax calls from any store i define to determine if server session is still active.

    did you try to make this work using your sample below? if not, give it a whirl and let us know what you experience.

  3. #3
    Sencha Premium Member zmagyar's Avatar
    Join Date
    Mar 2012
    Location
    Budapest
    Posts
    94
    Vote Rating
    2
      0  

    Default

    I can not see how can I define the base class in Architect. When the store is created in Architect the code in the sample is auto generated. So I can not see any way to add my 'extend' bit.

Posting Permissions

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