Results 1 to 3 of 3

Thread: Virtual Store each() method

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    23

    Default Virtual Store each() method

    Unfortunatelly Virtual Store still lacks each() method. I've just found how to emulate it, hope it will be usefull for someone. In Virtual Store override I've added such code:

    Code:
        
    forEach: function(func) {
        if(this.activeRanges) {
            this.activeRanges.forEach(function(range) {
                for(let idx in range.records) {
                    func(range.records[idx], idx);
                }
            });
        }
    }
    I've used name forEach instead of each because I hope sometime in the future the store will get it's own each method, so to not override it stay with this name.
    Also I've noticed that many of the usual store methods based on current store data doesn't work Virtual store lucks .getData() method (like findBy, getNewRecords, getModifiedRecords etc). So now I may if needed add overrides for this functions basing on currently loaded records.
    If someone have any info about Virtual Store development roadmap it would be good to share it. Thank you in advance.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Is it very useful? Because the whole purpose of a virtual store is that it does not contain your entire dataset.

  3. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    23

    Default

    This just for already loaded (cached) records. Othervise you just can't even access to what is loaded...
    Records are loaded not only for user to see them, your app also sometimes need to know what is loaded and perform some actions on it.
    For example, I need to show in some place (tab badge) count of records with some attribute (count of unread messages), and I do not want have extra service and request to get this number from server - I've already have requested data, just whant analize them, I guess I have right for this...

Similar Threads

  1. Selection in a Virtual Store
    By marta.gonzalez in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 31 Aug 2017, 3:38 AM
  2. Update on the Virtual Store?
    By JoraRst in forum Sencha Ext JS Q&A
    Replies: 0
    Last Post: 11 Jun 2017, 1:34 PM
  3. Hide virtual keyboard when focus in text field (NOT blur method)
    By thienminh201191 in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 7 Mar 2014, 1:58 PM
  4. Replies: 1
    Last Post: 16 Nov 2011, 10:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •