Always show groups in p:timeline

Community Driven Extensions Project
Post Reply
gernan
Posts: 28
Joined: 06 Oct 2012, 05:15

30 Aug 2014, 16:35

Hello guys!

Is there anyway to always show groups in p:timeline? Even if there's no event with some of these groups?
I need that because I'm using p:timeline component to implement something like an agenda, but without date, just using hours (7am to 23pm using the same random date to start and end dates) and days of the week, so the days are the groups. I'm using enumeration to the days of the week.

So, I want to keep all the values in the enumeration like a group in a p:timeline, and I want they are always visible.

Thank you!
Primefaces 6.0 | Primefaces Extensions 6.1.0 | Glassfish 4.1.0 | Mojarra 2.2.8
Hibernate 4.3.10 Final | NetBeans 8.1 | JDK 1.8.0_45

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

03 Sep 2014, 22:58

I have answered this questions 100+ times in this forum. No, it is not possible. It is probably possible in the new vis.js script (native script for this widget, see http://visjs.org/#example). The problem is, vis.js doesn't contain all features yet which are used in the current timeline implementation. You can consider a PRO support, otherwise we don't have any needs to implement this feature currently by ourself. In short words, we will not port the current timeline impl. to the new one as long as nobody pays for that.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
sebargarcia
Posts: 44
Joined: 01 Apr 2011, 00:24
Location: Salta, Argentina

07 Sep 2014, 02:37

One way i found to do this is to create invisible events for each group. It is not a solution but a kind of hack. When your timeline loads you have to create an event for each group and set for thats events this style:

Code: Select all

div.invisible-item{
     display: block; 
     visibility: hidden;
}
Add events like this

Code: Select all

TimelineEvent evt = new TimelineEvent(YourObject, beginDate, endDate,  false, idGroup,"invisible-item");
This works also for set consistent heigth to the groups when the groups has no events. As i said it is not a good solution but works.
Netbeans 8.0, Mojarra 2.1.26 , Primefaces 5, PrimeFaces Extensions 2.0.0, OmniFaces 1.8.1 , Glassfish 3.1.2.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

10 Sep 2014, 20:56

Yes, I know about this workaround. I think some other users use the same "hack".
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

gernan
Posts: 28
Joined: 06 Oct 2012, 05:15

11 Sep 2014, 20:07

Thank you guys!
I'll try it now!
Primefaces 6.0 | Primefaces Extensions 6.1.0 | Glassfish 4.1.0 | Mojarra 2.2.8
Hibernate 4.3.10 Final | NetBeans 8.1 | JDK 1.8.0_45

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests