groupsOrder

74 views
Skip to first unread message

Warley Ferreira Silva

unread,
Mar 19, 2014, 9:24:49 AM3/19/14
to chap-link...@googlegroups.com
Good day, I need to implement a customized ordering of groups on the timeline component and analyzing documentation realized a configuration option called "groupsOrder", where I could spend a ranking function. Could provide me an example of how you might use this option?

Thanks.

Jos de Jong

unread,
Mar 21, 2014, 5:23:35 AM3/21/14
to chap-link...@googlegroups.com
The default implementation of the sorting function for groups is:

function groupsOrder (a, b) {
    if (a.content > b.content) {
        return 1;
    }
    if (a.content < b.content) {
        return -1;
    }
    return 0;
};

Warley Ferreira Silva

unread,
Mar 21, 2014, 8:03:43 AM3/21/14
to chap-link...@googlegroups.com
Hello Jos, Thanks for the reply. I had succeeded in my case the data within textual content are listed alphabetically and not interest me, so I made a function that fixed numerical values for each text value, thereby indicating the precedence of a value relative to the other and so returning -1 or 1. Anyway thanks for the reply.

Warley Ferreira Silva
MCP/MCSA/MCSE 2003 e MCTS 2008/Vista
Graduando em Sistemas de Informação
Tel: (31) 3827-27 20
Cel: (31) 8317-48 22


--
You received this message because you are subscribed to a topic in the Google Groups "CHAP Links Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chap-links-library/vRj1VH_Tkyk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chap-links-libr...@googlegroups.com.
To post to this group, send email to chap-link...@googlegroups.com.
Visit this group at http://groups.google.com/group/chap-links-library.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages