1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    72
    Answers
    3
    Vote Rating
    2
    sephyroth69 is on a distinguished road

      1  

    Default Unanswered: "Cannot call method down of null" error on updating my list store

    Unanswered: "Cannot call method down of null" error on updating my list store


    I have 2 stores. When the first (store A) is loaded, I start loading the other (store from the 'refresh' event of store A. I first copy store A into store B then modify some stuff in it by calling store.each to apply modification on every record.
    But this line breaks everything and I don't get why :
    record.set('name', 'some name');

    My record do have a name property but whatever the property i try to set, I get an error in this sencha touch function where item comes in undefined and then extItem becomes null (which at least explains the error 'down of null') :

    updateListItem: function(record, item) {

    var me = this,
    dataview = me.dataview,

    extItem = Ext.fly(item),
    innerItem = extItem.down(me.labelClsCache, true),
    data = record.data,
    disclosureProperty = dataview.getDisclosureProperty(),
    disclosure = data && data.hasOwnProperty(disclosureProperty),
    iconSrc = data && data.hasOwnProperty('iconSrc'),
    disclosureEl, iconEl;

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    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


    Do you have a test case?
    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
    Nov 2011
    Posts
    72
    Answers
    3
    Vote Rating
    2
    sephyroth69 is on a distinguished road

      0  

    Default


    I'll try adding one tonight or tomorrow !

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    72
    Answers
    3
    Vote Rating
    2
    sephyroth69 is on a distinguished road

      0  

    Default


    I can't reproduce it with a simpler test case. This issue is not showing and the refresh event does work with the setter inside it and all...
    I guess there was something wrong in my code...
    I changed it completely to avoid doing this.

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    trunghung is on a distinguished road

      0  

    Default I am seeing the same issue

    I am seeing the same issue


    This bug definite exists, however it doesn't always happen all the time, but when it does, it will repro everytime the store is refreshed.

    The issue is here

    onStoreUpdate: function(store, record, newIndex, oldIndex) {
    var me = this,
    container = me.container;
    oldIndex = (typeof oldIndex === 'undefined') ? newIndex : oldIndex;




    if (oldIndex !== newIndex) {
    container.moveItemsToCache(oldIndex, oldIndex);
    container.moveItemsFromCache([record]);
    }
    else {
    // Bypassing setter because sometimes we pass the same record (different data)
    container.updateListItem(record, container.getViewItems()[newIndex]);
    }
    }

    container.getViewItems()[newIndex] return an undefined item, that's why it throws an error when the code try to call .down inside updateListItem
    var me = this,
    dataview = me.dataview,
    extItem = Ext.fly(item),
    innerItem = extItem.down(me.labelClsCache, true),

  6. #6
    Sencha User
    Join Date
    Jun 2013
    Posts
    45
    Answers
    1
    Vote Rating
    4
    AdamMarshall is on a distinguished road

      0  

    Default


    I get this as well, when rejecting changes to a record.

    It happens in

    Code:
    afterReject: function(record) {
            var index = this.data.indexOf(record);
            this.fireEvent('updaterecord', this, record, index, index, [], {});
        },
    For some reason, it is not finding the record in the store's data, and then returns -1 which leads to the eventual error in updateListItem.

    If I change the first line from
    Code:
    this.data.indexOf(record)
    to

    Code:
    this.data.all.indexOf(record)
    or

    Code:
    this.data.items.indexOf(record)
    it works.


    Is this issue fixed in more recent version of Sencha Touch? The codebase I am working in is using 2.0.0

  7. #7
    Sencha User
    Join Date
    Jun 2013
    Posts
    45
    Answers
    1
    Vote Rating
    4
    AdamMarshall is on a distinguished road

      0  

    Default


    Bump: anyone solved this?

  8. #8
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    62
    Vote Rating
    0
    info@ferraresegroup.com is on a distinguished road

      0  

    Default Cannot call method down of null...

    Cannot call method down of null...


    Same (my) code, different js, different result:

    Using ExtJs 4.2.2 with ext/ext-dev.js error found.
    With ExtJs 4.2.2 with path/ext-all-debug-w-comments.js error NOT FOUND!
    With ExtJs 4.2.2 with ext/ext-all.js error found....

    Why?

  9. #9
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    62
    Vote Rating
    0
    info@ferraresegroup.com is on a distinguished road

      0  

    Default Idea

    Idea


    This can help to find a solution:

    on click in a button extjs create a locked grid (ExtJs 4.2.2) i have a store with group feature, so the first time i load the store all go right.
    The second time i click on the same button the grid is create this error appear (cannot call method down of null).
    If i delete groupField on store config all go right but without group feature...

    Line error in Table.js:2250
    return (me.isGrouping ? Ext.fly(item) : this.el).down('table.x-grid-table');

    Anyone can help me?

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."