-
1 May 2012 6:26 AM #1
Answered: [Ext.dataview.DataView] itemTpl is not working like tpl on Sencha Touch 1
Answered: [Ext.dataview.DataView] itemTpl is not working like tpl on Sencha Touch 1
Hello,
I'm trying to run this code on Sencha Touch 2:
But on Sencha Touch 2 the tpl loop doesn't work (a table is created for each item).Code:this._myDataView = new Ext.DataView({ scrollable: false, store: this.myStore, itemTpl: new myapp.xtemplate.OrderDetail( this, '', ['{[this.someFunctionToDoOneTime()]}', '<div class="someClassToNotShowNamesInThisPost">', '<table>', '<tbody>', '<tpl for=".">', '{[this.someFunctionToDoEachTime(values)]}', '<tr>', '<td colspan="2">', '<div>{...}</div>', '<div>{[this....(values....)]}</div>', '</td>', '</tr>', '</tpl>', '</tbody>', '</table>', '</div>']), itemSelector: 'select.' + this...., disableSelection: true });
For info, i used the tpl and not the itemtpl on Sencha Touch 1 and it worked...
I've seen the comments on the tpl config from Ext.dataview.DataView but it's not helping...
Did you find a solution to this problem?
Thanks
-
Best Answer Posted by mitchellsimoens
The reason is because each record in the dataview is a container so you only have access to the one record. You can use CSS' display rule to change how the <div> elements render and can then make it act like a table.
-
3 May 2012 4:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
The reason is because each record in the dataview is a container so you only have access to the one record. You can use CSS' display rule to change how the <div> elements render and can then make it act like a table.
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.


Reply With Quote