Results 1 to 4 of 4

Thread: Met a strange problem in sencha, view can not get the store in the code

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default Unanswered: Met a strange problem in sencha, view can not get the store in the code

    We met a strange problem, currently we using Sencha Touch 2. with Sencha Touch Chart 2., the problem is in the chart view, it can not binding the store already defined and it always show error: Uncaught TypeError: Cannot call method 'each' of null

    Here is the code:
    var columnChart = new Ext.chart.Chart({


    animate: true,
    theme:'Demo',
    //store: Ext.StoreMgr.get("previewStore"),
    animate: {
    easing: 'bounceOut',
    duration: 750
    },
    store: 'HBarStore',

    It looks that the HBarStore can not be found, while I can get the store in controller, with
    var hBarStore = Ext.data.StoreManager.lookup('HBarStore');
    I am not sure what's wrong, is it a bug or already existing issue? This really block us.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,336
    Answers
    3885
    Vote Rating
    1296
      0  

    Default

    When you create this chart, are you sure the store has been instantiated?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default

    Yes, the store has init, and we tested it works with the following parrameter:

    It is quite strange that we must init the class in the store file, is it a bug?


    Ext.define("demo.store.OccNum", {
    extend: 'Ext.data.Store',
    alias: 'store.occNumStore',
    requires: [demo.model.OccNum'],
    config: {
    id:"occNumStore",
    model: demo.model.OccNum',
    }
    });
    Ext.create("demo.store.OccNum",{
    id:"occNumStore"
    });

  4. #4
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    623
    Answers
    67
    Vote Rating
    29
      0  

    Default

    I think for the store you need to use storeId config property not id.


    http://docs.sencha.com/touch/2-0/#!/...re-cfg-storeId

Posting Permissions

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