Results 1 to 2 of 2

Thread: GXT 2.0.1 - XmlPagingLoadResultReader buggy - proposed fix

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
      0  

    Default GXT 2.0.1 - XmlPagingLoadResultReader buggy - proposed fix

    Hi,

    The PagingToolBar does not work in 2.0.1 using an XmlPagingLoadResultReader.

    The protected method createReturnData should be overriden in XmlPagingLoadResultReader so that the PagingLoadResult object instance returned has a correct offset value.

    This offset value is used in the PagingToolBar onLoad(LoadEvent e) method to recalculate the
    activePage.

    The proposed fix is to implement with an override the method createReturnData in XmlPagingLoadResultReader with

    Code:
    @Override
    protected Object createReturnData(Object loadConfig, List<ModelData> records, int totalCount) {
        Object result =  super.createReturnData(loadConfig, records, totalCount);
        if (result instanceof PagingLoadResult) {
            PagingLoadResult<?> r = (PagingLoadResult<?>) result;
            r.setTotalLength(totalCount);
            r.setOffset(((PagingLoadConfig)loadConfig).getOffset());
        }
        return result;
    }

    Bruno

    www.amalto.com

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    This is already 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
  •