mardi 15 avril 2014

Extending component - field render issue

I am having render difficulties while extending DatePicker component.

I would like to add "timefield" bellow days table.

Problem is that timefield renderes with default width, ignoring my settings.

What I have (image attachec):



Code:




Ext.define('Ext.ux.DateTimePicker', {
extend: 'Ext.picker.Date',
......

onRender: function(container, position) {

this.callParent(arguments);

this.timefield = new Ext.form.field.Time({
increment: 30,
format: "H:i",
minValue: "07:00",
maxValue: "18:00",
width: 60,
ownerCt: this,
fieldLabel: "Time",
labelWidth: 40,
value: Ext.Date.format(this.value, "H:i")
});

var table = Ext.get(Ext.DomQuery.selectNode('table', this.el.dom));

var elem = Ext.DomHelper.insertAfter(table, {
tag: "div",
}, true);

this.timefield.render(elem);
}

datepicker.jpg


Aucun commentaire:

Enregistrer un commentaire