1

Ext.dataview.Dataview unlike Ext.dataview.List does not have a striped attribute.
Is there a straightforward way of simulating that?

I've tried using itemTpl in my DataView, but no luck.

itemTpl: '<tpl for=".">' + 
             '<div class="{[xindex % 2 === 0 ? "even" : "odd"]}"></div>' + 
         '</tpl>'

Maybe my "for clause" is wrong. Maybe I shouldn't be iterating through the root node...

pushkin
  • 9,575
  • 15
  • 51
  • 95

1 Answers1

1

If you are using the itemTpl in the DataView the xindex value will be always one. Since it will create the xtemplate for each dataview item.

You can try using the css:

dataviewItemCls:nth-child(even) {background: #CCC}
dataviewItemCls:nth-child(odd) {background: #FFF}

ref :- http://www.w3.org/Style/Examples/007/evenodd.en.html  

Qiu
  • 5,651
  • 10
  • 49
  • 56