Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    606
    Vote Rating
    26
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default Model Associations will not work for client proxies

    Model Associations will not work for client proxies


    I was trying to use model with associations on a flow that only use localstorage and I realized that it is impossible.

    HasMany association is forcing filtering remote. You can resolve this by passing in association config store:{remoteFiltering:false} but there is also forced modelDefaults with foreignKey: me.get(primaryKey), and this one is made like this:

    Code:
    modelDefaults[foreignKey] = me.get(primaryKey);
    
                    config = Ext.apply({}, storeConfig, {
                        model        : associatedModel,
                        filters      : [filter],
                        remoteFilter : true,
                        modelDefaults: modelDefaults
                    });
    So it is practically impossible to use HasMany association with client filtering and you will end having all the records in the associated model updated to have the associated.foreignKey = owner.primaryKey, because of the forced modelDefaults

    I guess it should be specified that Association are working only with remote filtering, so with server proxies. (at least by default)

  2. #2
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    606
    Vote Rating
    26
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    Some fixing (?)

    Code:
    hasMany: {
                model: 'MyApp.model.Book',
                autoLoad: true,
                foreignKey: 'id_author',
                store: {
                    remoteFilter: true,
                    modelDefaults: false,
                    proxy: {
                        type: 'maskingproxy',
                        maskedStore: 'Books'
                    }
                }
            }
    Code:
    Ext.define(
    'MaskingProxy',
     {
       extend:'Ext.data.proxy.LocalStorage',
       alias:'proxy.maskingproxy',
       config:{
          maskedStore:false,
       },
        read: function(operation, callback, scope) {
    	   
    	   var filters = operation.getFilters();
               
    	   var store = Ext.StoreManager.lookup( this.getMaskedStore() );
    	   store.clearFilter(true);
    	   store.setFilters(filters);
    
              //I know my store is loaded :P
    
    	  var rec = store.getRange(0,store.getCount()-1);
    	  operation.setSuccessful();
    	  operation.setCompleted();
    	  operation.setResultSet(Ext.create('Ext.data.ResultSet', {
                records: rec,
                total  : rec.length,
                loaded : true
            }));
            operation.setRecords(rec);
    	  callback.call(scope,operation);
    	  
    	}
     }
    );