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 User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,345
    Answers
    499
    Vote Rating
    250
    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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar