I want to display the total number of items in a view right next to the view name. Something like this:
Is there a way to do this OOTB or using JQuery? I am using SharePoint 2013 Online.
Any help is appreciated.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Have you considered grouping the table with the Status ? Which would then show total number of items for each group.
If you prefer to do it as you suggest, yes it can be done using JQuery. You need to use an $.ajax call to retrieve list items. You may be better off with two queries filtering each status option.
Then the Open and Overdue links are stored in DIVs with IDs WPQ2_ListTitleViewSelectorMenu_Container_surfaceopt1, 2 ; allowing you to append the count next to them.
Not a very elegant solution as the order of these items may change. However I see no reason why it wouldn't work.