Vlookup "Count" on list view – issue with groups

Home Forums vLooup for SharePoint Vlookup "Count" on list view – issue with groups

Viewing 4 reply threads
  • Author
    Posts
    • #10078
      AdamP
      Participant

        Hi Alexander

        We have come across a possible bug when using vlookup on a list view to provide a count of the number of child items. (vLookup_ListView.html in a CEWP on the page displaying the list items)

        With no grouping set on the sharepoint library view…everything works fine, paging through to the next page of items 31-60 etc returns the correct count on every item that has child items.

        With any grouping set on the library view – anything after the first “page” of groups doesn’t return any count results from vLookup. We assume this is due to how the next set of items are loaded by sharepoint…

        Could you confirm if this has been seen before, and if it’s likely to be easily fixable?

        Thanks

        Adam

      • #10090
        Alexander Bautz
        Keymaster

          Hi,
          Yes, I have see this before. Which version of vLookup are you using? – and how are you calling the function in the list view?

          If you are using SP 2013 you can look at the “v2.204 frontend” change log for a possible change to the function call: https://spjsblog.com/vlookup-for-sharepoint/vlookup-change-log/

          Alexander

          • #10126
            AdamP
            Participant

              A bit more clarity after further investigation…

              The issue occurs with the ajax item paging within a group, not the “full” paging at the bottom of the page. See attached image. Navigating to the next set of items kills the vlookup data, as does navigating back onto the first set of items that was displayed.

              Also of note – if I turn on the ajax options on the library view – ‘Enable Asynchronous Update’ etc – the vLookup data doesn’t show at all, even when the page initially loads.

          • #10096
            AdamP
            Participant

              Hi Alexander

              We’re currently on SP2010, calling vLookup_listview.html from a CEWP below the library.

              vLookup Backend v2.251
              vLookup Frontend v2.253

              I’m pretty sure that we used vLookup_listview.html from the same DFFS package (18 October 2015), it looks identical to the code in the change log for v2.204. Should we be using something different for SP2010?

              Adam

            • #10135
              Alexander Bautz
              Keymaster

                Hi,
                Unfortunately I don’t know how to detect the asynchronous refresh of a paged view in SP 2010, but here is a workaround that should work. Change the function call in the file “vLookup_ListView.html” from this:

                $(window).on('hashchange', function(){
                	spjs.vLookup.init();
                });

                To this if you use SP 2010:

                var spjs_msPageState = "";
                setInterval(function(){
                	var a = $(".ms-paging").text();
                	if(a !== spjs_msPageState){
                		spjs.vLookup.init();
                		spjs_msPageState = a;
                	}
                },1000);

                This should check if the paging has changed every 1000ms and recall the function if necessary.

                Let me know if this works.

                Alexander

              • #10137
                AdamP
                Participant

                  Thank you Alexander! This does the job perfectly.

                  I did initially think it hadn’t worked as I had left the ajax options enabled from the last test – in that case none of the vLookup data will display. Disabling them all (back to defaults) made everything work. Something to remember to check if people are having problems.

                  Adam

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