I'm currently trying to apply the new language strings to already rendered components, e.g. the date picker!
The ExtJS Locales are being applied to the prototype of the component, so actually I would need to make the components reRender their content afterwards!
Code:
if(Ext.form.field.Date){
Ext.apply(Ext.form.field.Date.prototype, {
disabledDaysText : "Disabled",
disabledDatesText : "Disabled",
minText : "The date in this field must be after {0}",
maxText : "The date in this field must be before {0}",
invalidText : "{0} is not a valid date - it must be in the format {1}",
format : "m/d/y",
altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d"
});
}
This seems to be a bit tricky. With a datefield for instance this works perfectly when I just call:
Code:
component.initComponent()
The result is that the dateformat in the field changes on the fly!
The same things works half way for the datepicker of the field, but not for an unfloating datepicker. Here I get a second datepicker inserted, but with all correct language strings applied!
So my question is if there is any way to make the component reRender without side effects? Calling
Code:
component.onRender()
produces errors if i don't put in the body as argument...but then my datepicker renders to the body...
You can see that I'm a bit lost into trial and error here. So any help or good explanations about reRendering components flawlessly is very much appriciated!