locked
Shared Documents RRS feed

  • Question

  • Hello,

    I am working on a sharepoint site and I've to put five document library on a single page but I dont want all 5 of them to be visible, rather I want to filter according to the user requirements. I want to put a drop down box which has got the titles of all the five document libraries, and if say the user selects "Library A" from the drop down box then the library with title A should be visible and so on.

    thank you,


    Rajnish Sinha
    Monday, August 22, 2011 4:22 PM

Answers

  • Check the solution available with Codeplex, 

    http://spvisibilityfilter.codeplex.com/


    --Cheers
    Monday, August 22, 2011 4:55 PM
  • You could also put together some simple jquery to show hide based on a drop down. I setup the drop down to have the id's of the webparts and then give them some descriptive text.

    <select id='mySelect'>
    <option value='MSOZoneCell_WebPartWPQ4'>WEBPART1</option>
    <option value='MSOZoneCell_WebPartWPQ3'>WEBPART2</option>
    </select>
    
    
    <script type='text/javascript'>
    
    $(document).ready(function(){
    
     $("#mySelect").change(function(){
    
     //show the selected element
     var selectedVal = $(this).find("option:selected").val();
     $("#" + selectedVal).show();
    
     //cycle through drop down and hide other elements
     $("#mySelect option").each(function(){
      var value = $(this).val();
      if(value != selectedVal)
      {
       $("#" + value).hide();
      }
     });
    
     });
    
    });
    </script>
    
    

     


    -tom daly
    Tuesday, August 23, 2011 3:37 AM

All replies

  • Check the solution available with Codeplex, 

    http://spvisibilityfilter.codeplex.com/


    --Cheers
    Monday, August 22, 2011 4:55 PM
  • You could also put together some simple jquery to show hide based on a drop down. I setup the drop down to have the id's of the webparts and then give them some descriptive text.

    <select id='mySelect'>
    <option value='MSOZoneCell_WebPartWPQ4'>WEBPART1</option>
    <option value='MSOZoneCell_WebPartWPQ3'>WEBPART2</option>
    </select>
    
    
    <script type='text/javascript'>
    
    $(document).ready(function(){
    
     $("#mySelect").change(function(){
    
     //show the selected element
     var selectedVal = $(this).find("option:selected").val();
     $("#" + selectedVal).show();
    
     //cycle through drop down and hide other elements
     $("#mySelect option").each(function(){
      var value = $(this).val();
      if(value != selectedVal)
      {
       $("#" + value).hide();
      }
     });
    
     });
    
    });
    </script>
    
    

     


    -tom daly
    Tuesday, August 23, 2011 3:37 AM