Group & Count

Forums vLooup for SharePoint Group & Count

Viewing 4 reply threads
  • Author
    Posts
    • #14882
      Eric Dickerson
      Participant

      I would like to use the GroupBy option and show the count of items in that group on the header… is there a specific header style or label code that I could use to show the count in the header?

    • #14973
      Alexander Bautz
      Keymaster

      Unfortunately there is not built in method for showing the count in the group header. The only built in method is to use the “Totals” option, but this will only show when you have expanded the group.

      Alexander

    • #15082
      DCH
      Participant

      I tried to write some code to accomplish this using the vLookupIsLoadedCallback function but I can’t get it to work. I am able to use alerts to validate that the callback and my function are getting called, but the object I build is empty. It works perfectly in the javascript console but not when using the DFFS Custom JS tab. Could you take a look and see what I am doing wrong?

      Also, I couldn’t find a way to get the subtotals from each group using the vlookup data object. It seemed to only contain the overall total.

      function vLookupIsLoadedCallback(fin){
          if(fin === "vLookupTasks"){
              alert("in callback");
              appendSubtotals();
          }
      }
      
      function appendSubtotals() {
              // create nodeset of TRs that contain complete progressbar divs
              var apc = $(".vLookup_total_vLookupTasks .vLookupProgressBarOuter").parent();
              alert("in function");
              // iterate through the nodeset
              $.each(apc, function() { 
                  // grab the text
                  var pcnt = $(this).text();
                  // find the parent element that lets us find the header
                  var par = $(this).parents(".vLookupGroup").siblings(".vLookupGroupHeader");  
                  // append the percentcomplete text to the header
                  $(par).append(" -" + pcnt);
              });
      }
      • This reply was modified 7 years, 3 months ago by DCH.
    • #15119
      DCH
      Participant

      I found that if I wrap my function in a setTimeout for 10ms then it works fine.

    • #15125
      Alexander Bautz
      Keymaster

      I’m glad you found a workaround.

      Alexander

Viewing 4 reply threads
  • You must be logged in to reply to this topic.