-
5 Feb 2012 11:18 PM #1
Unanswered: List with Other Controls
Unanswered: List with Other Controls
I tried to add a control (SelectField) into list items so every time list load records, that would have select field.
Currently I am using following code on list Painted event.
The above code works as expected but if the list has paging enabled the next loaded items don't get it because painted event is not fired and if it had fired, few list items would have more than one controls added whereas only one is needed. Is there a better way to do it in Sencha Touch 2 Beta version?Code:this.theStore.each(function(record) { var target = Ext.get("u-list-column-" + record.get('id')); Ext.create('Ext.field.Select', { cls : 'u-select', options : options, renderTo : target }); });
-
6 Feb 2012 9:27 AM #2
With B1 the Sencha Team released Dataview components.
You can find more info at the following link
http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.component.DataItem
Hope this helps.Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
6 Feb 2012 9:30 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,661
- Vote Rating
- 435
- Answers
- 3109
Check out the Kiva example for a DataView (useComponents) in action
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Feb 2012 6:13 AM #4
I tried this new feature, this is really good. Is that possible to put pinned headers at the top of each column in that DataView?
And as this example goes.
How can I concatenate data properties with custom string. Something like...Code:dataMap: { // When the record is updated, get the text configuration, and // call setHtml with the 'text' field of the record. getText: { setHtml: 'text' }, // When the record is updated, get the userName configuration, and // call setHtml with the 'from_user' field of the record. getUserName: { setHtml: 'from_user' }, // When the record is updated, get the avatar configuration, and // call `setSrc` with the 'profile_image_url' field of the record. getAvatar: { setSrc: 'profile_image_url' } },
Code:getPrice: { setHtml: 'price' + ' USD' },


Reply With Quote