The events are not being removed correctly from the timeline. Using smartgwt 6.0p power 13.08.16
Code:
public class TestingModule implements EntryPoint { private int i = 0; public void onModuleLoad() { VLayout vlayout = new VLayout(); final Timeline calendar = new Timeline(); calendar.setHeight(451); calendar.setStartDate(new Date(112, 5, 2)); calendar.setEndDate(new Date(112, 5, 22)); calendar.setCanEditLane(true); calendar.setShowEventDescriptions(false); HeaderLevel[] headerLevels = new HeaderLevel[] { new HeaderLevel(TimeUnit.WEEK), new HeaderLevel(TimeUnit.DAY) }; calendar.setHeaderLevels(headerLevels); calendar.setLaneFields(new ListGridField[] { new ListGridField("title", "Developer", 120) }); calendar.setLanes(TimelineLaneData.getRecords()); calendar.setData(TimelineData.getRecords()); calendar.setCanEditLane(false); vlayout.addMember(calendar); IButton removeBtn = new IButton("Remove first lane"); removeBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Lane lane = calendar.getLanes()[i]; for (CalendarEvent e : calendar.getLaneEvents(lane)) { SC.logWarn("Removing event: " + e.getName() + " " + e.getEventId()); calendar.removeEvent(e); } calendar.removeLane(lane.getName()); i++; } }); vlayout.setWidth100(); vlayout.setHeight100(); vlayout.addMember(removeBtn); vlayout.draw(); } }
Comment