PDA

View Full Version : how to make reusable component for hr tag in extjs?



Chiranjib
17 Jan 2012, 12:38 AM
How to bring a horizontal line that will fit in a form by extending a box component?

Chiranjib
17 Jan 2012, 3:21 AM
I tried it by extedning form.field.

Ext.form.myline = Ext.extend(Ext.form.Field, {



onRender: function(ct, position) {


if(!this.el){
alert(this.autoWidth)

this.defaultAutoCreate = {
tag: "hr",
style:"background-color:"+this.color+";height:"+this.size+"px;width:100%;"
};
}
Ext.form.myline.superclass.onRender.apply(this, arguments);
}



});


Ext.reg('myline', Ext.form.myline);


When I am using myline as xtype everything working fine.But the problem is that the width of the xtype is not taking as the width of the form.I need the width of the horizontal line should take throughout the width of the form?Is there any idea how can I DO THAT?


Thanks in advance,
Chiranjib