Results 1 to 4 of 4

Thread: Error: Cannot read property 'children' of undefined.

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    91

    Default Error: Cannot read property 'children' of undefined.

    When I load a store using Proxy, and push the list view from Navigator view, I am getting this error after first rendering of the list. Has anyone run into this issue before?

    var songstore = Ext.data.StoreManager.lookup('SonglStore');


    songlist = list.down('#dataList');
    if (!songstore.isLoaded()) {
    var url = 'http://www.qqqf.com/app/getSl.php';
    songstore.getProxy().setUrl(url);
    songstore.load(this);
    }

    after assigning filter value.

    songstore.setFilters(sfilter);
    songstore.load();
    songlist.addListener('itemtap',this.onListItemTap,this);
    console.log(list.getId());
    me.getMainNav().push(list);
    }

    Thanks,
    ST

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    What class/method is that error happening on?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    91

    Default

    Mitchell:

    it errors on this line:

    me.getMainNav().push(list);

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    91

    Default

    @Mitchell,

    I think I've resolved this issue. Please validate if this is the expected behavior.

    Scenario1:
    When I load the store inline, apply filter to the store and push() from navigationView it displays filtered list. When I 'back' to mainview and apply filter again based on the new selection, it applies the filter corresponding to that selection and displays in List view. No problem there.

    Scenario 2:
    I load the store through JsonP, apply the filter and push() like in previous case, it works first time but not for subsequent selection.

    Resolution:
    I started analyzing step by step and discovered, that the second filter is being applied to already filtered data set in Scenario 2. Not sure why - an explanation will be great.

    So, I clearFilter() ed and applied the filter every time on full data set - which is working fine.

    I am wondering why we have different behavior depending on how the store is loaded.

    But for now, I have resolved this issue and am moving on.

Posting Permissions

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