Adding relationship count to tab name

rated by 0 users
This post has 1 Reply | 1 Follower

Top 75 Contributor
Posts 16
Points 210
jenC Posted: Thu, Mar 18 2010 2:33 PM

Hi,

we would like to implement a standard behavior on all of our relationship grids such that the tab name would update to include the number of relationships on that tab.

For instance, if I had 4 tabs (Comments, Change Log, Tasks, Linked Workflows), when someone opened the item type, the tabs would change names to display the number of related items on each tab (so they know if they should bother looking at them))

Something like:

Comments (4), Change Log(2), Tasks, Linked Workflows (12)

I'm pretty sure I can figure out where to do this my modifying an html/script file (like relationshipsGrid.html perhaps).

If I do, will I affect anything in a negative way?  Will getTabID("Comments") still work?  Or would I need to modify that method as well to strip out parentheses when comparing?

Basically wondering if anyone sees a reason I shouldn't implement this functionality.

  • | Post Points: 5
Top 75 Contributor
Posts 16
Points 210
jenC replied on Fri, Mar 19 2010 1:33 PM

I've run into a few gotchas:

1.  Federated relationships - no way to populate count on this without running the federated OnGet event which can be time consuming.

2.  If a user adds a new relationship, saves the item, the tab name doesn't refresh to display the new count.

 

Any ideas to get around this?  BTW, the code I found to modify is in relationships.html in initRelTabbar() .  Turns out the tab already contains an attribute called "relationships_in_db" so I just appended that to the tab label and passed it in to the add tab method.

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS