PDA

View Full Version : Some notes on DataView in PR1



Jamie Avins
11 Oct 2011, 11:19 AM
It is is still planned to have DataView undergo some large 'under the hood' changes I wanted to talk about.

Currently, there are now two different behaviors for DataView. One acts as it did in the past where youuse an XTemplate and generate HTML markup which generates your lists. There has been a lot of cleanup of this class and DataPanel is now deprecated. The new Dataview behavior uses Components (currently ComponentView though this WILL change) where you can include any component in the library into your store controlled DataView. The only issue with the ComponentView Class is that we were not happy with it's performance when used for simpler things such as a plain list, but works great for more complex lists such as the one used in our twitter example. Currently they only API difference between the two is that the former uses and itemTpl and the latter uses itemConfig. We do plan on merging these two together into a single DataView in a later release.

arislaw
25 Oct 2011, 8:11 AM
Tks James for this alerts!

James, what happen with the tpl attribute? I am trying to set but it doesn't work at all...

I need to change the whole body of the DataView, but I could not set the tpl attribute.

Could you give me a example on how to define (Ext.define) a new dataview and set the tpl attribute?

Plsssss! I only need this to launch my first Sencha Touch 2 app :-)

Jamie Avins
25 Oct 2011, 3:39 PM
Use itemTpl for now, we're going to keep the old tpl there for backward compatibility.

http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.DataView

There's working examples in the docs with the code behind them.