-
4 Dec 2011 4:39 AM #1
prepareData not working in List?
prepareData not working in List?
Both variables show up blank in the template. In regular Ext JS 4, this works perfectly. Is there a new way to do this in Touch 2 or is this a bug?
Code:{ xtype: 'list', store: 'SomeStore', itemTpl: [ '<div>{shortTitle}</div>', '<div>{sometest}</div>' ], prepareData: function(data) { Ext.apply(data, { shortTitle: Ext.util.Format.ellipsis(data.name, 7), sometest: 'Test' }); return data; } }
-
4 Dec 2011 12:31 PM #2
This is a bug. I've added it to our bug tracker.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
12 Jan 2012 10:17 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
This has been fixed for the next release.
-
19 Jan 2012 1:11 AM #4
just wondering...
just wondering...
when do you think you guys'll release the prepareData bug fixed version? any rough ideas?
-
19 Jan 2012 9:05 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
I can't give any dates as of yet, should be soon though.
-
8 Jul 2012 9:59 PM #6
Is this really fixed?
Is this really fixed?
I'm using version 2.0.1.1 and am running into this problem using an Ext.dataview.List instance, where prepareData is not being called at all.
Is the fix in some other version or have I found something else?
Code:var cfg = { extend:'Ext.dataview.List'; config: { store: myStore; itemTpl: [ '<tpl for=".">', '<div class="requests-wrap x-data-item" id="request-{ID}">', '{title}', '<span>{summary}</span>', '<span>{subject}</span>', '</div>', '</tpl>', '<div class="x-clear"></div>' ].join(''), prepareData: function(data, recordIndex, record) { // Never called Ext.apply(data, { title: "My Title, summary: "My Summary" }); return data; }, } } Ext.define('myName', cfg);
Thanks,
Neil
-
10 Jul 2012 11:49 PM #7
Did anyone that had this problem earlier get a fix in a later release?
Is there a workaround?
Thanks,
Neil
-
5 Oct 2012 11:26 AM #8
Broken in RC1
Broken in RC1
RC1 doesn't use the data from prepareData to actually populate the itemTpl. prepareData gets called by the DataItem class but then the ListItem call ListItem.getBody().setRecord(record) which is what results in rendering of the itemTpl the ListItem.getBody() does not have the prepareData but only a getData(true).
-
19 Oct 2012 7:03 AM #9Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
This has been fixed for the next release. Thanks for the report.
-
20 Mar 2013 9:52 AM #10
And which release is that? You posted in October 2012. This is March 2013, using Sencha Touch 2.1.1 and the function still does not get called.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1176
in
Sprint 26.


Reply With Quote
