Maintaining values on a 2013 Sharepoint List after applying mult-select filter.

I have a SharePoint list, with the below JavaScript insert in a content editor below the list. The script opens a SharePoint 2013 List Items Directly into Edit View.That part works right. 

The problem I'm having is when I using the multi-select filter.

I select multiple items, I click on an item to open it (after I apply the filter). After I open it and click closed, it goes back to the page but the multi-select filter options are clear out and it shows the whole list.  But the selection are still checked.

Is there a way to maintain the values until they are manually cleared out?

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$
(function() {
 
// Change all display form links to edit form links
  $
('.ms-vb a[href*="listform.aspx"]').each(function(){
     
var link = $(this).attr('href');
      link
= link.replace("PageType=4", "PageType=6");
      $
(this).attr('href', link);
 
});
});
</script

May 27th, 2015 4:13pm

Hi,

According to your description, my understanding is that the filter didnt work after you closed the list item and went back to the list page.

I have tested in my environment and the filter worked fine after closing the list item.

Please remove the Content Editor web part and test whether this issue occurs.

If the issue still occurs, please test in a new list in a site collection without customization.

Besides, I suggest you to change the code as below. Since the code you use only works after fleshing the whole page. If the view changes, it will not work.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(function() {
   var interval = setInterval(changeType, 500);
});
function changeType()
{
                // Change all display form links to edit form links
                $('.ms-vb a[href*="listform.aspx"]').each(function(){
                    var link = $(this).attr('href');
                    link = link.replace("PageType=4", "PageType=6");
                    $(this).attr('href', link);
                });
}
</script>

Best Regards,

Dean Wang

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 9:27pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics