Results 1 to 3 of 3

Thread: Store.loadRecords should fire an additional event apart from add/datachanged

  1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
      0  

    Default Store.loadRecords should fire an additional event apart from add/datachanged

    I believe in Ext, store.loadRecords fires the 'load' event. But in Touch 2, this method calls 'add' which further calls 'insert' which fires the 'add' event, and then the 'datachanged' event.
    'loadRecords' itself then fires 'datachanged' again.

    If you are doing some time consuming operation in 'datachanged', it gets executed twice. So one solution is to remove firing 'datachanged' from loadRecords method.

    But 'datachanged' is fired on add/remove/updation of records. There are cases where loading of records into store needs to be handled separately especially when append is false, e.g.:
    store.loadData(jsonArray, false);

    This is similar to loading of record, albeit locally. So 'load' or another new event needs to be fored from loadRecords method.

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    I wouldn't recommend using 'datachanged' for anything. It's seriously flawed and we are adding many new events into the data package. This is not a 'bug' per say so I'm going to move this to the discussion area.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User
    Join Date
    Mar 2009
    Posts
    240
    Vote Rating
    0
      0  

    Default

    I was also not sure whether to call this a bug or a design decision. I will watch out for the upcoming release with the "many new events".
    Any timeline for preview 3/alpha 1?

Posting Permissions

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