PDA

View Full Version : Extended DataView - render question



ronivcp
22 Jul 2010, 12:57 PM
Hi, I'm trying to use the example (http://www.sencha.com/deploy/dev/examples/) page code with the extended dataView. The code is working properly, the only thing I need is to show the rows collapsed at first. (they are expanded at first)

Here's some code:


myDataView = function(config) {

myDataView .superclass.constructor.call(this,config);
};

Ext.extend(myDataView ,Ext.DataView, {
autoHeight : true,
frame : true,
itemSelector : 'dd',
tpl : myTPL,

onClick : function(e){
var group = e.getTarget('h2', 3, true);
if(group){
group.up('div').toggleClass('collapsed');
}
}
})

Ext.reg('myDataView ',myDataView );

var panel = new Ext.Panel({
frame : true,
renderTo : 'mydiv',
items : new myDataView ({
store : store
})
});
I have no idea how to do this, maybe going through each row, collapsing them? I don't know how to do this neither.
Any ideas? Thanks in advance!!

ronivcp
26 Jul 2010, 12:04 PM
bump

Condor
27 Jul 2010, 12:40 AM
Modify your myTPL to include class="collapsed" in the <div> element.