event on repaint

Ask for help relating to our Sencha Touch based Scheduler (for iPad, or any other supported phone, phablet or tablet)
User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

event on repaint

Post by pincherhgz »

we change dynamically styles of html elements inside our events (created by xtemplates). As soon as we do a drag&drop the styles that we applied are lost and the original layout is shown.
Is there any event after such a repaint that we can use to call our style refresh ?

User avatar
mats
Core Developer
Core Developer
Posts: 16756
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: event on repaint

Post by mats »

Not sure how you do your rendering, your Xtemplates are used as the eventBodyTemplate template? Can you show a sample of how you do this?

http://www.bryntum.com/docs/scheduling/ ... dyTemplate
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: event on repaint

Post by pincherhgz »

we tried the refresh event, but this is fired to early to get elements, we need it after the html is painted

User avatar
mats
Core Developer
Core Developer
Posts: 16756
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: event on repaint

Post by mats »

Sorry, not following. Test case needed :)
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: event on repaint

Post by pincherhgz »

yes we are using the eventBodyTemplate. In this template we set ids in tags and get the elements via document.getElementById()

User avatar
mats
Core Developer
Core Developer
Posts: 16756
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: event on repaint

Post by mats »

But why?
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: event on repaint

Post by pincherhgz »

let me try do describe again in detail:
- we are using an xtemplate in eventBodyTemplate, we set ids in some html tags
- after the events are rendered we get the elements using document.getElementById() and set the style (a background color)
- when we drag&drop an event, this event is painted again
- we would need an event after the repaint of a single event or after repaint of the complete grid after a zoom

User avatar
mats
Core Developer
Core Developer
Posts: 16756
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: event on repaint

Post by mats »

Ok, this is definitely not the way to do it. You should have all the tools to do the styling at render time. Please see and use the 'eventRenderer' hook. No need to set dom id's etc, too much work :)

http://www.bryntum.com/docs/scheduling/ ... ntRenderer
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: event on repaint

Post by pincherhgz »

why ? the scheduler will be shown in one application on a huge dashboard and from time to time the event state changes depending from machines that are started .... In this case we directly change the style of the html elements. This works perfect, not any problem

User avatar
mats
Core Developer
Core Developer
Posts: 16756
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: event on repaint

Post by mats »

It is a problem, because you're manually needing to repaint elements in *a lot* of scenarios. You don't need to, just work with the API provided with the component, it supports all you're trying to achieve (by using the 'eventRenderer')
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

Post Reply