Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: store.clear() removes all items of the list returned by store.getAll()

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #11
    Ext GWT Premium Member
    Join Date
    Aug 2010
    Location
    Germany, Solingen
    Posts
    277
    Vote Rating
    3
      0  

    Default

    Yes, it is. :-)

  2. #12
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    You are right guys, this is a little inconsistent - ListStore was supposed to have specific javadocs indicating what it is doing.

    Store.getAll() doesn't know what exactly will be done to implement this feature - in the case of TreeStore there is good way to make a list that doesn't involve a copy. There are a number of places that need to make this call, and rather than two calls, one with copy, one without, I'm currently of the opinion that the copy should be optional.

    I will file this as an issue so we can review it further, but I wanted to get additional feedback here too - Store.getAll() will be modified to be clear that a copy may be made, and ListStore.getAll will be modified to override the javadocs in Store.

  3. #13
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
      0  

    Default

    This sounds great, thank you!
    After reading this topic I was a little bit afraid that ListStore.getAll() really does copy all the values. And that wouldn't be that great, since I'm using it a lot

  4. #14
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    We may be getting outside the scope of this discussion (join me on irc.freenode.net at #extgwt for more discussion), but what are you using it so much for? If you are iterating through elements with a for-each loop and are concerned about performance, strongly consider switching to a for(int i = 0;...) loop, which is typically much better performing in GWT code, especially in IE.

    Code:
    for (int i = 0; i < listStore.size(); i++) {
       Obj o = listStore.get(i);

Page 2 of 2 FirstFirst 12

Posting Permissions

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