PDA

View Full Version : How to add alternate row color in sencha tree



offshoreteam
1 Apr 2013, 5:30 AM
I would like to add alternate row color in sencha tree.
Please refer below image:

42809

slemmon
3 Apr 2013, 3:09 PM
See if the stripeRows (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.view.Table-cfg-stripeRows) config (within the treepanel's (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.tree.Panel) viewConfig (http://docs.sencha.com/ext-js/4-2/#!/api/Ext.tree.Panel-cfg-viewConfig)) is what you're looking for. I think it might just be. :)



var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "detention", leaf: true },
{ text: "homework", expanded: true, children: [
{ text: "book report", leaf: true },
{ text: "algebra", leaf: true}
] },
{ text: "buy lottery tickets", leaf: true }
]
}
});


Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody(),
viewConfig: {
stripeRows: true
}
});