List view – only show parent rows with vLookup data

Forums vLooup for SharePoint List view – only show parent rows with vLookup data

Viewing 0 reply threads
  • Author
    Posts
    • #19452
      AdamP
      Participant

      I’ve got a need to only display rows in the parent list when they have vLookup child items, basically a high level filter of the parent list using data from the child list.
      Unfortunately the vLookupIsLoadedCallback doesn’t work for list views;

      Please note that this code does NOT trigger in a list view, only in NewForm, DispForm and EditForm.

      I think I’ve come up with a reasonable method to achieve what I need, but would welcome feedback and ideas to improve on it. This snippet is added to a CEWP below the list and CEWP containing vLookup_ListView.html;

      setInterval(function(){
      $( “span.vLookupNoItemsLabel” )
      .closest( “tr.ms-itmhover” )
      .hide();
      }, 2000);

      It runs on a 2 second interval, looks for the vLookupNoItemsLabel class in the list view, then hides the associated table row for the parent item. I think the 2 second interval should account for grouping expand/collapse and delayed or slow loading of the vLookup. See attached a couple of images standard/filtered

      Any thoughts?

      AdamP

      • This topic was modified 2 years, 2 months ago by AdamP.
Viewing 0 reply threads
  • You must be logged in to reply to this topic.