Hi,
I would like to have a calendar with both day and week view:
calendar.setShowDayView(true);
calendar.setShowWeekView(true);
calendar.setShowMonthView(false);
This is working fine, but I would also like to have lanes in day view, so:
calendar.setShowDayLanes(true);
And got this js error:
Complete test case:
MichalG
SmartClient Version: SNAPSHOT_v12.1d_2019-05-13/LGPL Development Only (built 2019-05-13)
ps. Hope to get some other hint than "not supported" :-)
I would like to have a calendar with both day and week view:
calendar.setShowDayView(true);
calendar.setShowWeekView(true);
calendar.setShowMonthView(false);
This is working fine, but I would also like to have lanes in day view, so:
calendar.setShowDayLanes(true);
And got this js error:
Code:
15:22:34.226:WARN:Log:TypeError: Cannot read property 'getTime' of null
Stack from error.stack:
cons.getDateTopOffset(<no args: exited>) on [WeekSchedule ID:isc_Calendar_0_weekView] @ CalendarView.js:4155:33
cons.getSnapData(<no args: exited>) on [WeekSchedule ID:isc_Calendar_0_weekView] @ CalendarView.js:2715:32
cons.tagDataForOverlap(<no args: exited>) on [WeekSchedule ID:isc_Calendar_0_weekView] @ CalendarView.js:2820:46
cons.refreshEvents(<no args: exited>) on [WeekSchedule ID:isc_Calendar_0_weekView] @ CalendarView.js:3652:14
cons.draw(<no args: exited>) on [WeekSchedule ID:isc_Calendar_0_weekView] @ CalendarView.js:4280:18
cons.layoutChildren(<no args: exited>) on [PaneContainer ID:isc_Calendar_0_mainView_paneContainer] @ Layout.js:2592:20
cons.drawChildren(<no args: exited>) on [PaneContainer ID:isc_Calendar_0_mainView_paneContainer] @ Layout.js:1381:11
cons.draw(<no args: exited>) on [PaneContainer ID:isc_Calendar_0_mainView_paneContainer] @ Canvas.js:5187:14
cons.drawChildren(<no args: exited>) on [TabSet ID:isc_Calendar_0_mainView] @ Canvas.js:6165:37
cons.draw(<no args: exited>) on [TabSet ID:isc_Calendar_0_mainView] @ Canvas.js:5187:14
cons.invokeSuper(<no args: exited>) on [TabSet ID:isc_Calendar_0_mainView] @ Class.js:1622:40
cons.draw(<no args: exited>) on [TabSet ID:isc_Calendar_0_mainView] @ TabSet.js:2033:10
cons.layoutChildren(<no args: exited>) on [HLayout ID:isc_HLayout_0] @ Layout.js:2592:20
cons.drawChildren(<no args: exited>) on [HLayout ID:isc_HLayout_0] @ Layout.js:1381:11
cons.draw(<no args: exited>) on [HLayout ID:isc_HLayout_0] @ Canvas.js:5187:14
cons.drawChildren(<no args: exited>) on [Calendar ID:isc_Calendar_0] @ Canvas.js:6165:37
cons.draw(<no args: exited>) on [Calendar ID:isc_Calendar_0] @ Canvas.js:5187:14
cons.invokeSuper(<no args: exited>) on [Calendar ID:isc_Calendar_0] @ Class.js:1622:40
cons.draw(<no args: exited>) on [Calendar ID:isc_Calendar_0] @ Calendar.js:5960:10
Ghh_g$.rye_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:35259:13
wPm_g$.xPm_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:205864:17
wPm_g$.yPm_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:205868:8
Array.HFc_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:14311:27
initializeModules_0_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:28:30
qL_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:4414:28
tL_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:4484:14
<anonymous>(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:4450:14
_Ec_g$(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:41:40
<anonymous>(<no args: exited>) @ 8A4693DFB016126B1C2DFCE4AD45ED74.cache.js:205886:46
Code:
package pl.com.tech4.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.calendar.Calendar;
import com.smartgwt.client.widgets.calendar.Lane;
import java.util.Date;
public class MainEntryPoint implements EntryPoint {
public void onModuleLoad() {
layout();
SC.showConsole();
}
private void layout() {
Calendar calendar = new Calendar();
calendar.setStartDateField("startTime");
calendar.setEndDateField("endTime");
calendar.setShowDayView(true);
calendar.setShowDayLanes(true);
calendar.setShowWeekView(true);
calendar.setShowMonthView(false);
calendar.setShowWorkday(true);
Lane[] lanes = new Lane[1];
lanes[0] = new Lane("lane1", "Lane 1");
Record[] data = new Record[1];
data[0] = new Record();
data[0].setAttribute("name", "test");
data[0].setAttribute("title", "Test");
data[0].setAttribute("lane", "lane1");
Date today = new Date();
today.setMinutes(0);
Date hourLater = new Date();
hourLater.setHours(today.getHours() + 1);
hourLater.setMinutes(0);
data[0].setAttribute("startTime", today);
data[0].setAttribute("endTime", hourLater);
calendar.setLanes(lanes);
calendar.setData(data);
calendar.draw();
}
}
SmartClient Version: SNAPSHOT_v12.1d_2019-05-13/LGPL Development Only (built 2019-05-13)
ps. Hope to get some other hint than "not supported" :-)
Comment