search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Cells drawing problem

Asked by Davide
5 years ago.

Hi,
I've a problem for the first time!
When the page is completly loaded and visible on my browser, the cells content is padded to left incorrectly.
Infact the content (also the back color) is out of cell border!
But, if I resize the browser page, everything are corrected and the Scheduler is well drawn.
Really, I'm going crazy!

The same behavior is present in Explorer, Mozilla and Chrome.

I hope you can understand my problem's description. It's really incredible.
Davide

Comment posted by Davide
5 years ago.

I've "solved" by creating all resources collapsed.
When I expand one resource the cells width are correctly drawn.
This solution works for me.

Bye
Davide

Answer posted by Dan Letecky [DayPilot]
5 years ago.

Strange issue.

The Scheduler doesn't get rendered properly when it's in a hidden part of a page during initialization (such as an inactive tab). This happens because the browser doesn't calculate dimensions for hidden elements. The Scheduler watches its state and fixes itself when it becomes available (e.g. when you activate the tab). This usually prevents these problems.

If it fails for some reason, you can also force a quick refresh by calling dp.show() on the client side (where "dp" is the value of ClientObjectName property).

Comment posted by Davide
5 years ago.

Yes Dan, it's a very strange issue.
I've discovered that it is enough to resize one pixel of one column to display correctly all cells.

One question: when and how I can use the method dp.show() ?

Thank you for your effort

Comment posted by Dan Letecky [DayPilot]
5 years ago.

If you find a way to reproduce this problem just let me know, maybe it could be fixed inside DayPilot.

As far as I can tell something like this could happen if the page structure changes after the Scheduler is initialized. The latest sandbox build (8.3.3578+) includes improvements of runtime width detection. It should improve handling of the situations when the Scheduler width changes but the window width stays the same (i.e. changes of the page layout). You can test it to see if it fixes the problem:

http://www.daypilot.org/sandbox/

If it doesn't help you can try calling dp.show(). You can do it like this:

<DayPilot:DayPilotScheduler
...
ClientObjectName="dp"
/>

<script>
function fixView() {
  dp.show();
}
</script>

You can call fixView() when needed - usually it's after the page structure changes but the Scheduler doesn't update itself properly. If you have problems with the initial page load but don't have a good event handler to hook you can simply call it after a certain delay (that's an ugly workaround but it should help):

<script>
setTimeout(function() {
  fixView();
}, 200);
</script>
Comment posted by Davide
5 years ago.

Yes! It works as desired.
Thank you very much.

Davide

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.