1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    Xarem is on a distinguished road

      0  

    Default Unanswered: Sort Ext.data.Store after changing records

    Unanswered: Sort Ext.data.Store after changing records


    Hi all

    I'd like to change data, sort my Ext.data.Store with changed data and refresh the Ext.List.
    Can't understand why the store isn't sorted - can anyone help me?

    Thanks a lot!

    My callback after getting geolocation data:
    Code:
        setDistance: function(store, lat, lng) {
            var controller = this;
            
            store.each(function(record) {
                km = controller.calculateDistance(record.get('lat'), record.get('lng'), lat, lng);
                record.set('distance', km);
                store.sort('distance', 'ASC');
            });
            this.getViewJewelers().refresh();
    
        },
    My model:
    Code:
    Ext.define('XXX.model.Jeweler', {
        extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                { name: 'id', type: 'string' },
    ...
                { name: 'distance', type: 'int' },
            ],
        }
        
    });
    Store:
    Code:
    Ext.define('XXX.store.Jewelers', {
        extend: 'Ext.data.Store',
    
    
        config: {
            model: 'XXX.model.Jeweler',
            
            storeId: 'store-jewelers',
            
            proxy: {
                type: 'ajax',
                url: '/v1.0/jewelers.json',
                reader: {
                    type: 'json',
                }
            },
            
        }
        
    });

  2. #2
    Sencha User
    Join Date
    Nov 2012
    Posts
    3
    Vote Rating
    0
    Xarem is on a distinguished road

      0  

    Default


    Hi all

    I added this to my controller and now, it work's - strange but cool

    PHP Code:

            listeners
    : {

                
    initialize: function() {

                    var 
    store this.getStore();

                    
    store.addListener("refresh", function() {
                        
    this.refresh();

                    }, 
    this);

                },

            }, 

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