Results 1 to 7 of 7

Thread: prepareData in DataView should not override Record data

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default prepareData in DataView should not override Record data

    If you change the data return in the prepareData method in the DataView, it changes the actual data in the Record. This method is used as a renderer method so it should only change the data being sent to the template and not touch the Record.

    From API:

    Function which can be overridden to provide custom formatting for each Record that is used by this DataView's template to render each node.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  2. #2
    Touch Premium Member
    Join Date
    May 2011
    Posts
    29

    Default

    Bump! just ran into this myself when using your excellent Ext.ux.TouchGridPanel, any progress here? Has it been fixed? Thanks!

    PS: Yesterday opened the issue https://github.com/mitchellsimoens/E...Panel/issues/1 thinking it was a bug in your component and not in sencha, should I close it there and refer to this bug?

  3. #3
    Touch Premium Member
    Join Date
    May 2011
    Posts
    29

    Default

    Bump

  4. #4
    Touch Premium Member
    Join Date
    May 2011
    Posts
    29

    Default

    Any update about this bug? It's pretty bad that customizing the output of a DataView changes the record.

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    May not get fixed till ST 2.0
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #6
    Touch Premium Member
    Join Date
    May 2011
    Posts
    29

    Default

    As this bug was critical to my company we ended up spending some x-credits to get a fix for this one.

    Code:
    Ext.override(Ext.DataView, {
        collectData : function(records, startIndex){
            var r = [],
                i = 0,
                len = records.length;
    
            for(; i < len; i++){
                r[r.length] = this.prepareData(Ext.apply({}, records[i].data), startIndex + i, records[i]);
            }
    
            return r;
        }
    });

  7. #7
    Sencha User
    Join Date
    Apr 2011
    Location
    Spain
    Posts
    77

    Default PrepareData Override...

    Are there alredy any solution to this bug??
    Anybody know how fix it??

    I know this bug don't exist in sencha touch version 2.0 as this method don't exist, but I would be interested in solving it because I follow using the previous version of the framework.

    Thanks...

Similar Threads

  1. [CLOSED]DataView.prepareData is called twice
    By defcon1 in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 21 Apr 2010, 1:41 AM
  2. Simple override for Ext.data.Record - to improve efficiency
    By durlabh in forum Community Discussion
    Replies: 3
    Last Post: 7 Jun 2009, 7:14 PM
  3. Record, JsonReader, Store, DataView not loading data
    By incaic in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 25 Mar 2008, 2:39 PM

Posting Permissions

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