Reputation: 2613
I wrote code of ExtJS for date picker, and include it in two different HTML file. Height of text box is different in the first HTML file than in the other. My code is :
Ext.create('Ext.form.Panel', {
height: '15%',
width: $("#MainWindow_Right_Panel").width() - 20,
renderTo: 'FilterControl',
id: 'DatePicker_Panel',
border: 0,
items: [
{
xtype: 'datefield',
fieldLabel: 'To',
name: 'to_date',
style: 'float: right',
id: 'todate',
padding: 5,
width: 130,
labelWidth: 30,
value: todate,
maxValue: today,
format: "d.m.Y",
layout: 'form',
listeners: {
select: function(combo, value) {
todate=value;
}
}
},
{
xtype: 'datefield',
fieldLabel: 'From',
style: 'float: right',
labelWidth: 50,
width: 150,
name: '_fromdate',
padding: 5,
id: 'fromdate',
value:fromdate,
maxValue: today,
format: "d.m.Y",
layout: 'form',
listeners: {
select: function(combo, value) {
fromdate=value;
}
}
},
]
});
output in first HTML:
in the second:
Upvotes: 2
Views: 4105
Reputation: 36
you have to add cls:'x-border-box, x-border-box',
after add cls you code should be like this :
Ext.create('Ext.form.Panel', {
height: '15%',
width: $("#MainWindow_Right_Panel").width() - 20,
renderTo: 'FilterControl',
id: 'DatePicker_Panel',
border: 0,
items: [
{
xtype: 'datefield',
fieldLabel: 'To',
name: 'to_date',
style: 'float: right',
**cls:'x-border-box, x-border-box',**
id: 'todate',
padding: 5,
width: 130,
labelWidth: 30,
value: todate,
maxValue: today,
format: "d.m.Y",
layout: 'form',
listeners: {
select: function(combo, value) {
todate=value;
}
}
},
{
xtype: 'datefield',
fieldLabel: 'From',
style: 'float: right',
**cls:'x-border-box, x-border-box',**
labelWidth: 50,
width: 150,
name: '_fromdate',
padding: 5,
id: 'fromdate',
value:fromdate,
maxValue: today,
format: "d.m.Y",
layout: 'form',
listeners: {
select: function(combo, value) {
fromdate=value;
}
}
},
]
});
Upvotes: 2