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. #21
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Correct, both PagingStore and PagingMemoryProxy load the entire dataset and return only the current page.
    Condor, how would I be able to get the entire data set locally if needed. I'm trying to export the data in the Ext.ux.PagingStore to excel, but I only get the the page which is shown to the user as expected.

    Can you please let me know if this is possible? Though I could find out if this was possible with with the PagingStore's parent class.

    Thanks in advance..

  2. #22
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Quote Originally Posted by whodat View Post
    Condor, how would I be able to get the entire data set locally if needed. I'm trying to export the data in the Ext.ux.PagingStore to excel, but I only get the the page which is shown to the user as expected.

    Can you please let me know if this is possible? Though I could find out if this was possible with with the PagingStore's parent class.

    Thanks in advance..
    Got closer to completing this. So issue lies when calling the getTotalCount() from the PagingStore.

    this.store.getCount() = returns the size of the current page loaded in the grid and not the total number of records in the store as based on it's parent's implementation of getTotalCount().

    So instead of calling store.getCount(), I was able to get the total size of dataset by doing

    Code:
    this.store.allData.items.length
    And it returned the full data set size.
    Last edited by whodat; 9 Feb 2009 at 7:24 AM. Reason: Solved it.

  3. #23
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    82
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Yes, this.store.allData is a MixedCollection that contains all records.

    You can use it to export all data to Excel (the default code expects a store, but it can easily be changed to a MixedCollection).

  4. #24
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    If you want to force repaging after adding records you should use:
    Code:
    store.applyPaging();
    store.fireEvent('datachanged', store);
    Condor is this used anytime new records are reloaded or only when you add records to the store?

    One of the issues I noticed is, when the store is originally loaded with lets say 100 records showing 20 per page (so 5 pages).

    I then reload the store while I'm on page 3, 4, or 5 and there are only 40 records still showing 20 per page. The paging tool bar doesn't update correctly.

    By not updating correctly, it shows nothing in the grid since I am page 3, but I have the previous page option allows me to paginate to page 2 and then grid shows the 20 records.

    My question is, do I need to add a listener for reload and call applyPaging()?

  5. #25
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    82
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    That is something that is not properly handled by PagingStore.

    Could you try if this fixes it:
    Code:
    Ext.override(Ext.ux.data.PagingStore, {
    	loadRecords : function(o, options, success){
    		if(!o || success === false){
    			if(success !== false){
    				this.fireEvent("load", this, [], options);
    			}
    			if(options.callback){
    				options.callback.call(options.scope || this, [], options, false);
    			}
    			return;
    		}
    		var r = o.records, t = o.totalRecords || r.length;
    		if(!options || options.add !== true){
    			if(this.pruneModifiedRecords){
    				this.modified = [];
    			}
    			for(var i = 0, len = r.length; i < len; i++){
    				r[i].join(this);
    			}
    			if(this.allData){
    				this.data = this.allData;
    				delete this.allData;
    			}
    			if(this.snapshot){
    				this.data = this.snapshot;
    				delete this.snapshot;
    			}
    			this.data.clear();
    			this.data.addAll(r);
    			this.totalLength = t;
    			this.applySort();
    			if(!this.allData){
    				this.applyPaging();
    			}
    			if(r.length != this.getCount()){
    				r = [].concat(this.data.items);
    			}
    			this.fireEvent("datachanged", this);
    		}else{
    			this.totalLength = Math.max(t, this.data.length+r.length);
    			this.add(r);
    		}
    		options[this.paramNames.start] = this.start;
    		this.fireEvent("load", this, r, options);
    		if(options.callback){
    			options.callback.call(options.scope || this, r, options, true);
    		}
    	},
    	applyPaging : function(){
    		var start = this.start, limit = this.limit;
    		if((typeof start == 'number') && (typeof limit == 'number')){
    			var allData = this.data, data = new Ext.util.MixedCollection(allData.allowFunctions, allData.getKey);
    			if(start >= allData.getCount()){
    				start = this.start = allData.getCount() ? Math.floor((allData.getCount() - 1) / limit) : 0;
    			}
    			data.items = allData.items.slice(start, start + limit);
    			data.keys = allData.keys.slice(start, start + limit);
    			var len = data.length = data.items.length;
    			var map = {};
    			for(var i = 0; i < len; i++){
    				var item = data.items[i];
    				map[data.getKey(item)] = item;
    			}
    			data.map = map;
    			this.allData = allData;
    			this.data = data;
    		}
    	}
    });

  6. #26
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    That is something that is not properly handled by PagingStore.

    Could you try if this fixes it:
    Code:
    Ext.override(Ext.ux.data.PagingStore, {
        loadRecords : function(o, options, success){
            if(!o || success === false){
                if(success !== false){
                    this.fireEvent("load", this, [], options);
                }
                if(options.callback){
                    options.callback.call(options.scope || this, [], options, false);
                }
                return;
            }
            var r = o.records, t = o.totalRecords || r.length;
            if(!options || options.add !== true){
                if(this.pruneModifiedRecords){
                    this.modified = [];
                }
                for(var i = 0, len = r.length; i < len; i++){
                    r[i].join(this);
                }
                if(this.allData){
                    this.data = this.allData;
                    delete this.allData;
                }
                if(this.snapshot){
                    this.data = this.snapshot;
                    delete this.snapshot;
                }
                this.data.clear();
                this.data.addAll(r);
                this.totalLength = t;
                this.applySort();
                if(!this.allData){
                    this.applyPaging();
                }
                if(r.length != this.getCount()){
                    r = [].concat(this.data.items);
                }
                this.fireEvent("datachanged", this);
            }else{
                this.totalLength = Math.max(t, this.data.length+r.length);
                this.add(r);
            }
            options[this.paramNames.start] = this.start;
            this.fireEvent("load", this, r, options);
            if(options.callback){
                options.callback.call(options.scope || this, r, options, true);
            }
        },
        applyPaging : function(){
            var start = this.start, limit = this.limit;
            if((typeof start == 'number') && (typeof limit == 'number')){
                var allData = this.data, data = new Ext.util.MixedCollection(allData.allowFunctions, allData.getKey);
                if(start >= allData.getCount()){
                    start = this.start = allData.getCount() ? Math.floor((allData.getCount() - 1) / limit) : 0;
                }
                data.items = allData.items.slice(start, start + limit);
                data.keys = allData.keys.slice(start, start + limit);
                var len = data.length = data.items.length;
                var map = {};
                for(var i = 0; i < len; i++){
                    var item = data.items[i];
                    map[data.getKey(item)] = item;
                }
                data.map = map;
                this.allData = allData;
                this.data = data;
            }
        }
    });
    Thanks, will let you know..

  7. #27
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Is there somewhere significant I should place this code?

    I placed it right after
    Code:
    Ext.extend(Ext.ux.data.JsonPagingStore, Ext.ux.data.PagingStore);
    in the original PagingStore class.

    It doesn't seem to update the current page or the "Displaying parts " text.

    I have attached a screenshot. Unless you tell me I have placed your updated code in the wrong place.

    Please let me know Condor and thanks for your help.

    Just to clarify, I orginally loaded the store with 12 records, then reloaded the store again with 9 records while on the 2nd page of the first dataset.
    Attached Images

  8. #28
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Live exalpme please!!

    Greetings,

  9. #29
    Sencha User
    Join Date
    Dec 2008
    Location
    NYC
    Posts
    182
    Vote Rating
    0
    whodat is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    That is something that is not properly handled by PagingStore.

    Could you try if this fixes it:
    What did to correct this problem was the following:

    When I called reload to update the store with the new records.. I called reload with the following params

    ds.reload({params:{start: 0, limit: 10}});

    And everything was solved, the pages reloaded correctly.. Maybe not exactly the behavior you intended but for my users it will work.

    Thanks for the help.

  10. #30
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    82
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    The change I suggested should made sure that if you request a page that isn't in the dataset, the last page is shown instead.

    But if you already know you are forced reloading the data then you should indeed select the first page (as you do now).