Results 1 to 2 of 2

Thread: [FIXED] [2.0 M3] PagingModelMemoryProxy does not use DataReader

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    9
    Vote Rating
    0
      0  

    Default [FIXED] [2.0 M3] PagingModelMemoryProxy does not use DataReader

    It seems that PagingModelMemoryProxy does not use DataReader in its load method. Thus is not possible to use BeanModelMarker in the model.
    Here is source fragment of PagingModelMemoryProxy load method
    Code:
    public void load(DataReader<PagingLoadResult<? extends ModelData>> reader,
          Object loadConfig, AsyncCallback<PagingLoadResult<? extends ModelData>> callback) {
    
        PagingLoadConfig config = (PagingLoadConfig) loadConfig;
    
        if (config.getSortInfo().getSortField() != null) {
          final String sortField = config.getSortInfo().getSortField();
          if (sortField != null) {
            Collections.sort(data, config.getSortInfo().getSortDir().comparator(
                new Comparator<ModelData>() {
    
                  public int compare(ModelData o1, ModelData o2) {
                    Object v1 = (Object) o1.get(sortField);
                    Object v2 = (Object) o2.get(sortField);
    
                    if (comparator != null) {
                      return comparator.compare(v1, v2);
                    } else {
                      return DefaultComparator.INSTANCE.compare(v1, v2);
                    }
    
                  }
                }));
          }
    
        }
        ArrayList<ModelData> sublist = new ArrayList<ModelData>();
        int start = config.getOffset();
        int limit = data.size();
        if (config.getLimit() > 0) {
          limit = Math.min(start + config.getLimit(), limit);
        }
        for (int i = config.getOffset(); i < limit; i++) {
          sublist.add(data.get(i));
        }
        callback.onSuccess(new BasePagingLoadResult<ModelData>(sublist, config.getOffset(),
            data.size()));
      }

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
      0  

    Default

    Fixed in SVN.

Posting Permissions

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