none
Hide the count while doing GroupBy in Sharepoint list 2013. RRS feed

  • Question

  • Hi i'm having a list where performing groupby with two columns. I need only to display the items and have to hide the count that is being displayed.

    Ex:  DEPT:CSE(5)

                  SUBJECT:DataStructure(20)

          SUBJECT: OOPS(50)

          DEPT:ECE (8)

                        SUBJECT: SIGNALS(38)

        SUBJECT: ADC(42)   ---->  Here have to hide all the numbers in brackets...

    Thanks in advance!!!

    Thursday, January 22, 2015 5:45 AM

Answers

  • Hi,

    Please use the following code to remove the count.  You can use this code by adding to the script editor web part in the list view page. I have tested, it works perfectly.

     <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script>
    (function ($, undefined)
    {
     $(document).ready(function ()
        {
    
    $("td[class^='ms-gb']").each(function(){
    $(this).find("span:last").remove();
    });
    });
    })(jQuery);
    </script>
    Please don't forget to mark it answered, if your problem resolved or
    helpful.
    Thursday, January 22, 2015 6:31 AM

All replies

  • Hi,

    Please use the following code to remove the count.  You can use this code by adding to the script editor web part in the list view page. I have tested, it works perfectly.

     <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script>
    (function ($, undefined)
    {
     $(document).ready(function ()
        {
    
    $("td[class^='ms-gb']").each(function(){
    $(this).find("span:last").remove();
    });
    });
    })(jQuery);
    </script>
    Please don't forget to mark it answered, if your problem resolved or
    helpful.
    Thursday, January 22, 2015 6:31 AM
  •   Hi Mokhtar Bepari this code is working perfectly. Thanks !!!
    Thursday, January 22, 2015 8:55 AM
  • Hi,

    Or you can apply a CSS style as below:

    the outcome would be:

    Best regards


    Patrick Liang
    TechNet Community Support

    Friday, January 23, 2015 7:52 AM
    Moderator
  • Just curious - can I add the CSS code in a script editor? Or should I do this in SP Designer?

    Thanks!

    Thursday, June 15, 2017 11:19 PM