Organisation of events

Hello, Hello, 3-times Hello…

I don’t want to bother you, team, but bevore buying your product i need to detaily check out the possibilities :-/

It is a major point, that i need to view two sources within one scheduler. I made a custom unit-view working, so i got the events with type=0 (yellow) on the left and the ones with type=1 (red) on the right.
This view should be used for getting an overview!

Mainly we will use the day-view, so there both event types should appear!
The realy realy MAIN need is the following:
If there is an event with type=1 it need to be aligned ALWAYS on the same side (preffered: right). When we create a new one, in any view and set the type to 1 it has to align on the right, everytime… With the basic sorting-routine it seems to me, that it is by random where it approachs, when the events have tha same start- and end-date!
Where can i find the routine, so i can have a try on my own?

Next thing is, that when i expand a red event over 2 or more yellow events, the alignment is terrible!!! I mean, why is the whole space split in 1/3 - 1/3 - 1/3 ? Should only take 1/2 - 1/2… You can see everything at the screenshot.
With this behaviour i could not work :frowning: Perhaps it helps, when i say, that there is NO need to align more than 2 events in one row!! I mean, for example, 10:00-10:30 is only booked by ONE yellow and ONE red event, never more (for example there will never be an event 09:30-10:30)…

I got another question: Do you favour, when i FIRST buy a license and THEN ask for support? Perhaps this is more motivating?

Really best wishes,
2Fast


Hello

unfortunately scheduler doesn’t support this feature. All event are aligned only depending on their start_date. If you want to aling two events that start from the same data, you can try to modify the dhtmlxscheduler.js as follows:

try to locate line
scheduler._pre_render_events_line=function(evs,hold){

and add the highlighed line after it:

scheduler._pre_render_events_line=function(evs,hold){
evs.sort(function(a,b){ return a.type>b.type?1:-1; })

here type is property that you use to define event unit.

The Problem here is, that i don’t have an uncompressed version of the dhtmlxscheduler.js.
Or am i stupid? Tried the _debug.js, but it’s different (debugs, like name says :wink: )…

In case of compressed version you may try to modify the same method:

scheduler._pre_render_events_line=function(H,A){
H.sort(function(a,b){ return a.type>b.type?1:-1; })

Hey There…
Thanks for reply.

I can’t exactly see what it does, but the effect is … strange :wink:
Is this wanted by you two guys?


yes, the result is really weird :frowning: Try to do the following:

use the highlighted line:
scheduler._pre_render_events_line=function(H,A){H.sort(function(K,J){if(K.start_date==J.start_date) return K.type>J.type?1:-1;else return K.start_date>J.start_date?1:-1});

instead of

scheduler._pre_render_events_line=function(H,A){H.sort(function(K,J){return K.start_date>J.start_date?1:-1});

In this case the sorting will be executed by “type” property too. Also I’ve attached the patch that allows to solve the positioning problem.
scheduler_position_alt.zip (718 Bytes)

Hello!

I pointed out, that the following statement is not working:

K.start_date == J.start_date

I printed out the two values by alert(K.start_date+"\n"+J.start_date and they are tiotally identical, but he is never throwing a TRUE, so he is never running into the

return K.event_type>J.event_type?1:-1;

:frowning:
I prompted it, so it’s is really as i say :slight_smile:

My “type” is called “event_type”, so i changed it a bit, you can see above.
Is this a date object “start_date” so it can not be that easily be “==” ?

Thanks for your help in this point. I get what this section of the .js does :wink:

To your attached position-correction.js:
Many thanks! I will try to check that many code on my own to find what it does and how i could fit it more to my needs … As you can see at the screenshot attached, it works in a different way than my first screenshot, but now is the issue, that if tehre is on RED event (call it event_type = 1), then afterwards this day, there is allways a gap, it is halfed all the way down :slight_smile: Also with three events in a row (see @ 09. März), it is 1/3 all the way down if it approachs once.

I choosed the week view, to better show you, it is exactly the same in day view, like you could imagine :slight_smile:

A’m i right, that the first change into the dhtmlxscheduler.js is for positioning the events (red and yellow), so for emaple RED is allways right? And the extra javascript postioning file is for changing the blocking, boxing, don’t know how to say thing?

Good Night,
2Fast


Hello,

you may modify the solution i’ve provided before:

scheduler._pre_render_events_line=function(H,A){H.sort(function(K,J){if(K.start_date.valueOf()==J.start_date.valueOf()) return K.type>J.type?1:-1; else return K.start_date>J.start_date?1:-1});

The provided patch allows to display the event 8.45-9.00 under the event 8.30-8.45 (10 March on your picture).

Hey!
The provided patch allows to show it underneth, like you said, but it also disallows to display events where is no second event collapsing over the full width. Right?

I tried for over one hour, but i can’t get it running (also with the little fix) to order the red events all to the right… Seems like it got no effect… I iwll provide more datas tomorrow for this personal problem.

Best wishes,
2Fast