Hi There,
Big problem here, My need is to see all specified events in my timeline, no overlapping.
run this code example with the last build (5/30/2014).
Select June 1st 2014 in the date picker and you will not see event1001 and event 1006.
package defect.client;
import java.util.Date;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.calendar.CalendarEvent;
import com.smartgwt.client.widgets.calendar.Lane;
import com.smartgwt.client.widgets.calendar.Timeline;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class test implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
Lane[] developers = new Lane[] {
new Lane("charlesMadigen", "Charles QP Madigen"),
new Lane("tamaraKane", "Tamara Kane"),
new Lane("darcyFeeney", "Darcy Feeney"),
new Lane("kaiKong", "Kai Kong"),
new Lane("shelleyFewel", "Shelley Fewel"),
new Lane("garretMonroe", "Garret Monroe") };
Timeline calendar = new Timeline();
calendar.setHeight100();
calendar.setEventOverlap(false);
calendar.setStartDate(new Date(112, 5, 2));
calendar.setEndDate(new Date(112, 5, 22));
calendar.setLanes(developers);
calendar.setData(TimelineData.getRecords());
calendar.draw();
}
}
class TimelineData {
private static CalendarEvent[] records;
private static Date today = new Date();// Date(112, 5, 2);
private static int year = today.getYear();
private static int month = today.getMonth();
private static int start = today.getDate();
public static CalendarEvent[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public static CalendarEvent[] getNewRecords() {
return new CalendarEvent[] {
new CalendarEvent(1001, "Event 1001?", "Can't see you",
new Date(114, 5, 2), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1002, "Event 1002", " ",
new Date(114, 4, 31), new Date(114, 5, 1, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1003, "Event 1003", " ",
new Date(114, 4, 31), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1006, "event 1006?", "Can't see you",
new Date(114, 5, 2), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1007, "event 1007", " ", new Date(114, 5, 2),
new Date(114, 5, 2, 23, 59, 59), "darcyFeeney") };
}
}
Thanks.
Big problem here, My need is to see all specified events in my timeline, no overlapping.
run this code example with the last build (5/30/2014).
Select June 1st 2014 in the date picker and you will not see event1001 and event 1006.
package defect.client;
import java.util.Date;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.SortSpecifier;
import com.smartgwt.client.types.SortDirection;
import com.smartgwt.client.widgets.calendar.CalendarEvent;
import com.smartgwt.client.widgets.calendar.Lane;
import com.smartgwt.client.widgets.calendar.Timeline;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class test implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
Lane[] developers = new Lane[] {
new Lane("charlesMadigen", "Charles QP Madigen"),
new Lane("tamaraKane", "Tamara Kane"),
new Lane("darcyFeeney", "Darcy Feeney"),
new Lane("kaiKong", "Kai Kong"),
new Lane("shelleyFewel", "Shelley Fewel"),
new Lane("garretMonroe", "Garret Monroe") };
Timeline calendar = new Timeline();
calendar.setHeight100();
calendar.setEventOverlap(false);
calendar.setStartDate(new Date(112, 5, 2));
calendar.setEndDate(new Date(112, 5, 22));
calendar.setLanes(developers);
calendar.setData(TimelineData.getRecords());
calendar.draw();
}
}
class TimelineData {
private static CalendarEvent[] records;
private static Date today = new Date();// Date(112, 5, 2);
private static int year = today.getYear();
private static int month = today.getMonth();
private static int start = today.getDate();
public static CalendarEvent[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public static CalendarEvent[] getNewRecords() {
return new CalendarEvent[] {
new CalendarEvent(1001, "Event 1001?", "Can't see you",
new Date(114, 5, 2), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1002, "Event 1002", " ",
new Date(114, 4, 31), new Date(114, 5, 1, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1003, "Event 1003", " ",
new Date(114, 4, 31), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1006, "event 1006?", "Can't see you",
new Date(114, 5, 2), new Date(114, 5, 2, 23, 59, 59),
"darcyFeeney"),
new CalendarEvent(1007, "event 1007", " ", new Date(114, 5, 2),
new Date(114, 5, 2, 23, 59, 59), "darcyFeeney") };
}
}
Thanks.