1. #1
    Sencha User
    Join Date
    May 2011
    Location
    Belgium
    Posts
    16
    Vote Rating
    0
    julien.meyer is on a distinguished road

      0  

    Default Unanswered: Define a DESC grouper for a store

    Unanswered: Define a DESC grouper for a store


    Hello,
    I try to define a desc grouper for my store like this :
    Code:
    Ext.define('FDM.store.Parts', {
        extend: 'Ext.data.Store',
        model: 'FDM.model.Part',
        ...
        groupers:[{direction:'DESC', property:'type'}],
        ...
    But it doesn't work.
    After looking in the Store.js source file, I understand why.
    In the decodeGroupers function, if the grouper is not "instanceof" Grouper, it overwrite direction with 'ASC'.
    Code:
    decodeGroupers: function(groupers) {
    ...
                if (!(config instanceof Grouper)) {
    ...
                    Ext.applyIf(config, {
                        root     : 'data',
                        direction: "ASC"
                    });
    ...
    Why overwrite the value if this one exist ?

    To solve my problem, I extend the constructor method like this :
    Code:
    constructor: function(config) {
            config = Ext.apply({}, config);
            config.groupers = [new Ext.util.Grouper({direction:'DESC', property:'type'})];
            
            this.callParent([config]);
        }

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,588
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    What do you mean by 'it doesn't work'? What happens?

    I don't believe the line you've identified is the cause of your problem. Ext.applyIf() will not overwrite existing properties (unlike Ext.apply(), which will). You should be able to confirm this by putting breakpoints in just before and after that line.

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