You don't need the call to rebuild() - get rid of that and let us know what you see. If the first resize attempt seems not to work, let us know about that, but please also have a second attempt and post both results.
Announcement
Collapse
No announcement yet.
X
-
I have removed the rebuild() but still see the same problem.
I have a feeling you haven't understood what the problem is. Please reread the reply from 24th May 2015 11:53, and see the screenshot. The problem is not with the resize, that is just what triggers the adding of the client-side events. The problem is that resize-controls show up on the wrong elements.
Are you able to replicate this using the test case?
Comment
-
Okay, so when I resize a second time, the resize-controls disappear from the "clientSide" events like they should, but the resize-controls are still missing from 1 of the regular events (The one called Datasource Transaction-handling, see attached screenshot).
If I resize a third time then the resize-controls reappear on the "clientSide" events and it looks just like after the 1st resize.
It keeps alternating like this with every resize.
Comment
-
Something of a delay replying to this one - firstly, we're not sure if the technique you show in your test case is a technique you're actually using in your live code base, but it's not a very good idea, either way.
If you don't want the timeline to show the events it will naturally retrieve, don't ask it to retrieve them - just retrieve the ones you actually want, externally, and then setData() with the events you care about.
For your issues, though, we made some changes to 5.1 some days ago, and these are ported to 5.0 in time for builds dated June 10.
From your perspective, all events should now be assigned correct rolloverControls, even when useEventCanvasRolloverControls is false, as it is for you.
Secondly, a bunch of optimizations have been made to the rendering process, including blocking two expensive memory leaks in your circumstance.
Let us know if you have further issues.
Comment
-
Thank you, I'll try out the nightly tomorrow.
Let me try to explain in more detail what I do. (See attached screenshot for a picture of my current implementation)
I'm using the timeline to allocate work to the employees of a company. These allocations(green) have a percentage showing how much of the employee's time should be spend on this task. All these allocations are saved in my database and is fetched normally by the timeline.
When the allocations have been fetched I add some more events on the client-side to show where employees have time available(grey) or have been over-allocated(red).
Whenever an allocation is changed/added/removed in a lane, these client-side events then have to be updated to reflect this, so I basically run thought all the events in the timeline, filter out the "client-side" events of lane, calculate the new "client-side" events for the lanes and add them to the rest, and then setData on the timeline with the new data.
I'm debating whether or not to calculate the "client-side" events on the server instead, and then send together with the allocations in the fetch-servlet, but then I am unsure how I would handle the changed/added/removed case without having to re-fetch the whole thing again.
I hope this casts some light on my specific case, if you have any other questions or suggestions, please let me know.
PS. Right now I am calculating the highest amount of overlapping events on each lane and setting the lane height based on that because I don't want the events to become unreadable.
Is there a better/easier way to do this? It would be nice if I could set a minimum allowed eventHeight and the lanes would then expand to accommodate that.
Comment
-
SmartClient Version: v10.0p_2015-06-11/Pro Deployment (built 2015-06-11)
After testing with the new build, I'm seeing a some problems.
Events can overlap with a single day(or whatever the EventSnapGap is), this is also visible in the showcase: http://www.smartclient.com/smartgwt/showcase/#simple_timeline (try to move events so they overlap a single day)
Also, when updating an event's enddate by dragging on the right resize control, the enddate and preview is calculated wrong. This bug is also in the same showcase as above.
Attached is a picture that shows both bugs in the showcase.
I also found that when I add events to the timeline they are not drawn and I think this is also visible in the showcase. (If I press a date in the show case and add an event, it doesn't show up)
But the EventCanvasRolloverControls are showing perfectly :)
/Niels
Comment
-
Of your three issues - we fixed adding an event, and we're looking into the right-drag issue (and the size of the red drag-rectangle, which is also wrong, because it's using the same calculation).
But we're not sure what issue you're pointing out in your first point, about events overlapping on a single day - the image you attached doesn't seem to show any issues.
Can you rephrase what it is that you think is wrong?
Comment
-
SmartClient Version: v10.0p_2015-06-16/Pro Deployment (built 2015-06-16)
Hi, the new update works great but there is one new problem that showed up.
When I use setUseEventCanvasRolloverControls(false) the events show CloseButtons and ContextButtons even if I use setCanRemoveEvents(false).
These buttons don't show up if I use rollover controls.
I have attached a screenshot of the buttons i question.
My Timeline settings:
Code:timeline = new Timeline(); timeline.setWidth100(); timeline.setDisableWeekends(false); timeline.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE); timeline.setShowEventDescriptions(false); timeline.setCanCreateEvents(false); timeline.setEventLaneFieldTitle("Person"); timeline.setShowControlsBar(false); timeline.setShowQuickEventDialog(false); timeline.setCanRemoveEvents(false); timeline.setLaneEventPadding(3); timeline.setOverlapSortSpecifiers(new SortSpecifier("sortOrder", SortDirection.ASCENDING)); timeline.setLaneFields(new ListGridField("title", "People", 210)); timeline.setLanes(lanes); timeline.setDataSource(ds); timeline.setCanAcceptDrop(true); timeline.setShowZones(true); timeline.setZones(holidays.toArray(new CalendarEvent[holidays.size()])); timeline.setUseEventCanvasRolloverControls(false); timeline.setCanEditLane(false); Canvas properties = new Canvas(); properties.setHoverWidth(500); timeline.setAutoChildProperties("eventCanvas", properties); timeline.setDateStyleCustomizer(new DateStyleCustomizer() { @Override public String getDateStyle(Date date, int rowNum, int colNum, CalendarView calendarView) { // If we are currently showing the day view, set a different style for weekend days. if(timeline.getTimelineGranularity() == TimeUnit.DAY) { for (Integer weekendDay : DateUtil.getWeekendDays()) { if(date.getDay() == weekendDay) return "calendarResourcePlanningWorkdayDisabled"; } } return null; } }); timeline.setEventHeaderHTMLCustomizer(new EventHeaderHTMLCustomizer() { @Override public String getEventHeaderHTML(CalendarEvent calendarEvent, CalendarView calendarView) { return "<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tbody><tr><td valign='middle' align='middle' >" + calendarEvent.getName() + "</td></tr></tbody></table>"; } });
Comment
-
Ohh and also I just realized that events with canEdit = false still show resize controls when setUseEventCanvasRolloverControls is false.
This is also visible on the grey event on the screenshot above.
And when I run the Test-Case from post #12 I see some weird behavior.
Every time I update an event (to trigger the adding if the client events) it alternates between showing and not showing the "New Event 2" event. (see attached)
If I run the test-case without the rebuild command as you suggested, then the timeline doesn't change on the first event update, but if I then use the timeline controls to move forward and back in time then the change has become visible, so it seems like something is wrong with the drawing of the timeline in that case.
Comment
Comment