Threaded View

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Posts
    21
    Answers
    1
    Vote Rating
    0
    Cloudgatherer is on a distinguished road

      0  

    Default Answered: GroupingView - Custom Sort on GroupBy Column?

    Answered: GroupingView - Custom Sort on GroupBy Column?


    This strikes me as very simple, yet how to do this is eluding me.

    Suppose we a table/grid with 3 columns:
    - Group name (String)
    - Field name (String)
    - Field value (String)

    I want to sort by 1) group then 2) name. Seems simple, right?

    Creating the requisite ListStore, ColumnConfigs, Grid, and StoreSortInfo objects, I can achieve the sort ordering I want in the standard GridView.

    When I change the Grid's view to a GroupingView, specifying the groupBy as (obviously) group name, my custom sorting now seems to be ignored. I can easily go back and forth comparing the grid views, and the behavior works as expected in a regular GridView, but the sorting on the groupBy field seems to be ignored by the GroupingView.

    Any clues on what detail I'm missing to sort the groupBy column for a GroupingView?

  2. I was referring to doing a local sort and I've figured out the detail. The createStoreSortInfo reference was the clue, thanks.

    I had done the sorting via:
    Code:
    StoreSortInfo<Model> sortInfo = new StoreSortInfo<Model>(modelValueProvider, modelComparator, SortDir.ASC);
    store.addSortInfo(sortInfo);
    Instead, it must be done on the column config:
    Code:
    ColumnConfig<Model, String> modelColumnConfig = new ColumnConfig<Model, String>(modelValueProvider);
    modelColumnConfig.setComparator(modelComparator);
    GroupingView doesn't look at the first sort to see if that is correct, it automatically generates one by grabbing the Comparator from the ColumnConfig (which I had not set, and so I got the default sorting).

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi