Results 1 to 2 of 2

Thread: How to access to a Store from a controller?

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    9
    Vote Rating
    0
      0  

    Default How to access to a Store from a controller?

    Hi,

    i am using Ext JS since 2 days and i really like it.
    But there are often some small problems i cannot solve.

    I created my app with the MVC of the tutorial.

    I want to use the buffered Scrolling, see http://dev.sencha.com/deploy/ext-4.0...ffer-grid.html

    So i have to call the method
    Code:
    myStore.guaranteeRange(0, 199);
    for the buffered Scrolling plugin.

    My question is:
    How can i access to the store with the storeID "myStore" from a controller of my app?

    i tried:
    Code:
    Ext.define('gigadmin.controller.MyController', {    
       extend: 'Ext.app.Controller',
        views: [
            ...
        ],
        stores: [
            'MyStore'
        ],
        models: ['MyModel'],
        
        
        init: function() {
            this.control({
               ..
            });
            var myStore = Ext.data.StoreManager.lookup('myStore')
            myStore.guaranteeRange(0, 199);
        },
    });
    i also tried
    Code:
    this.getStore();
    .

    But both didn't work.

    Would be great if somebody knows how to fix that.

    Thanks for your help!

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    102
    Answers
    8
    Vote Rating
    6
      0  

    Default

    There are to methods to do this:
    Code:
    this.getMyStoreStore();
    
    this.getStore("MyStore");

Posting Permissions

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