1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
    UbuntuPenguin is on a distinguished road

      0  

    Default Unanswered: List Deselect on Store Change

    Unanswered: List Deselect on Store Change


    Hello Everyone,
    I have a list which has a selection and I have noticed that when I change the data in the bound store, the data changes, but the original selected object stays. It's as if the list is removing all of the old data except for the selected item. I have checked the mode of the list, and it is in "SINGLE" mode. Is this default behavior or should I do something else such as listen to the store update event and manually deselect my list.

    EDIT: Turns out that I am not actually changing the dataset, I am filtering the data set, and the item that remains selected shouldn't be passing the filter, but it is in the store.

    Any help is greatly appreciated.
    Last edited by UbuntuPenguin; 14 Mar 2012 at 3:48 PM. Reason: Clarification on what really is happening

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
    UbuntuPenguin is on a distinguished road

      0  

    Default


    The problem laid in the store.removeAll( doItLikeANinjaAndBreakEverything ) function. I had "doItLikeANinjaAndBreakEverything" set to true, so the store didn't fire off its refresh event. Here is the Sencha source

    Code:
            if (silent !== true) {            me.fireEvent('refresh', me, me.data);        }
    Once I set doItLikeANinjaAndBreakEverything to false it worked.

Tags for this Thread