Jump to content

Calendar Panel "Painted" event


kkelchev

Recommended Posts

 

Hi ,

Please , could you add Delphi support for "painted" calendar Event  ?

Meantime, please advise me how to find the right moment when the calendar is already fully drawn in the browser and some label elements could be change via JavaScript.
At the moment I'm using a timer but this solution is not good because it works like a "bullet in the dark"

Thanks

Kamen 

Untitled.png

Link to comment
Share on other sites

3 hours ago, kkelchev said:

Meantime, please advise me how to find the right moment when the calendar is already fully drawn in the browser and some label elements could be change via JavaScript.
At the moment I'm using a timer but this solution is not good because it works like a "bullet in the dark"

Can you clarify this point, what you wanted?

Link to comment
Share on other sites

I need to remove time labels from events .

So to do this I'm sending this to browser  .

  

UniSession.AddJS(Format(
    '%s.el.select(''.x-calendar-event-time-start'').elements.forEach(function(el){ el.innerHTML='''';});' +
    '%s.el.select(''.x-calendar-event-time-separator'').elements.forEach(function(el){ el.innerHTML='''';});' +
    '%s.el.select(''.x-calendar-event-time-end'').elements.forEach(function(el){ el.innerHTML='''';});', [CP.JSName, CP.JSName, CP.JSName]));

Here CP Is TuniCalendarPanel.

This code works fine.

The problem is when is right moment to send it to browser.

If it is send immediately after load events , in the browser Events "<div>" tags is still not created and code is executed with no effect.

For correct execution I'm starts timer with timeout around 3000 ms after load. That solve problem , but  it is not good solution

because :

 if network is speed enough there is delay between complete creation on event and label fix (el.innerHTML='''';)  that leads to flickering in labels and end user is not happy.

If network is slow or calendar contents more events scripts is executed (by timer) too early with no effect.

So:

Question is related to find right way for optimal synchronization between loading of calendars events and execution of scrips for correction like this.

Thanks Kamen

 

 

 

 

 

 

Link to comment
Share on other sites

4 minutes ago, kkelchev said:

I need to remove time labels from events .

So to do this I'm sending this to browser  .


UniSession.AddJS(Format(
    '%s.el.select(''.x-calendar-event-time-start'').elements.forEach(function(el){ el.innerHTML='''';});' +
    '%s.el.select(''.x-calendar-event-time-separator'').elements.forEach(function(el){ el.innerHTML='''';});' +
    '%s.el.select(''.x-calendar-event-time-end'').elements.forEach(function(el){ el.innerHTML='''';});', [CP.JSName, CP.JSName, CP.JSName]));

 

Can you make a simple testcase for reproduce, analyze?

Link to comment
Share on other sites

×
×
  • Create New...