I need to be able to hook into an event that is fired before any easyui element is rendered in order to switch it's label text with the language of the user.
I already have this working for Input Labels and are for datagrid are using the onBeforeOpen() event, but the change of text is visible to the user and they can see it change, I need to change it before the element is rendered.
If I don't add a delay to push it to the bottom of the stack, then the translation does not work as the element are not yet created.
onBeforeOpen: function(){
var me = $(this);
setTimeout(function(){
me.find('tr.datagrid-header-row td[field] .datagrid-cell > span:first-of-type').each(function(){
$(this).text(eui.translate($(this).text()));
})
})
}
I am really looking for a method that I can use globally, or an event that is fired for every element just before it gets rendered in order to change the label without the user seeing the change ?!