1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    16
    Vote Rating
    0
    likesencha-dl is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    When you create this chart, are you sure the store has been instantiated?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    likesencha-dl is on a distinguished road

      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
    606
    Answers
    66
    Vote Rating
    26
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      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

Thread Participants: 2