1. #1
    Sencha User
    Join Date
    Apr 2009
    Posts
    11
    Vote Rating
    1
    matthewdfleming is on a distinguished road

      0  

    Exclamation [1.2.4] Modified records are deleted across load operations (e.g., during paging).

    [1.2.4] Modified records are deleted across load operations (e.g., during paging).


    The ListStore is supposed to keep modified records across load calls but it does not

    Here is the onLoad method of ListStore. the call to removeAll() deletes the records in the store...

    Code:
      
    protected void onLoad(LoadEvent le) {
        this.config = (ListLoadConfig) le.config;
    
        Object data = le.data;
    
        removeAll();
    
        if (data instanceof List) {
          List<M> list = (List) le.data;
          all = list;
    
        } else if (data instanceof ListLoadResult) {
          all = ((ListLoadResult) data).getData();
        }
    
        for (M m : all) {
          registerModel(m);
        }
    
        if (le.config instanceof ListLoadConfig) {
          ListLoadConfig config = (ListLoadConfig) le.config;
          if (config.getSortInfo().getSortField() != null) {
            sortInfo = config.getSortInfo();
          } else {
            sortInfo = new SortInfo();
          }
        }
    
        if (filtersEnabled) {
          filtersEnabled = false;
          applyFilters(filterProperty);
        }
        if (storeSorter != null) {
          applySort(true);
        }
        fireEvent(DataChanged, createStoreEvent());
      }

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is not a bug but a feature requestment. Moving this to help forum so that moer people see it.

  3. #3
    Sencha User
    Join Date
    Apr 2009
    Posts
    11
    Vote Rating
    1
    matthewdfleming is on a distinguished road

      0  

    Default The Store javadoc is wrong then?

    The Store javadoc is wrong then?


    Here's the method that made me think it was a bug:

    Code:
      /**
       * Gets all records modified since the last commit. Modified records are
       * persisted across load operations (e.g., during paging).
       * 
       * @return a list of modified records
       */
      public List<Record> getModifiedRecords() {
        return new ArrayList<Record>(modified);
      }

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Reloading a store deletes all data in it. You can extend ListStore to add this feature if you need it. However this can end up in a memoryleak. I will correct the javadoc

  5. #5
    Sencha User
    Join Date
    Apr 2009
    Posts
    11
    Vote Rating
    1
    matthewdfleming is on a distinguished road

      0  

    Default


    Anything in particular that I should look out for with regards to a memory leak?

Thread Participants: 1