Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    After sorting turned on , when edit a column, sorting gets turned off .

    hi,
    After sorting turned on , when edit a column, sorting gets turned off .
    And i am trying to call different methods of sorting inside addDataChangedHandler , still sorting is not working.
    Different methods tried :
    setCanSort(true);
    setCanReorderRecords(true);
    setSortField(0);
    resort();

    ................................................................................
    addDataChangedHandler(event -> {
    if (Boolean.TRUE.equals(this.getResultSet().lengthIsKnown())) {

    GWT.log("spe" + getSortState());
    String vs = getSortState();
    GWT.log("sp" + vs);
    setCanSort(true);
    setCanReorderRecords(true);
    setSortField(0);

    }

    #3
    updatePartialCache is not working.

    addDataArrivedHandler(event-> {
    this.getResultSet().setUpdatePartialCache(true);

    });

    Please suggest other alternative.

    Comment


      #4
      See updatePartialCache docs: when you have a partial cache, after the sorted column is edited, there are only two choices:

      1. keep the cache but (correctly) remove the sort indicator, so that the edited record doesn't pop out of view (updatePartialCache:true). Then drop the cache if anything happens that relies on the current sort (such as scrolling to load more data)

      2. drop the cache and re-fetch (updatePartialCache:false)

      If you want #2, you must set updatePartialCache to false.

      Usually, you want the default, #1. A legit reason for #2 is relatively rare, so the likely thing you want to do here is: nothing, the behavior is already correct and as desired.

      Comment

      Working...
      X