Click here to Skip to main content
14,971,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am working on CSR rendering I have hidden/Removed some list items using jslink , but on header column filter it shows hidden/removed items also.
 
In breif ,I have two column in a list
 
Column1             column2
  A                 test1 
  B                 test2
  C                 test1
  D                 test3
 
I have hidden two list items B,D
 
Column1(for filter option it shows all items(A,B,C,D),but i need only (A,C) items to display)                                                      

Column2(for sort option it shows all items(test1,test2,test3),but i need only (test1) 
item to display 

 
I want to display on which is visible list items, in all header column filters 


What I have tried:

(function()  
 {  
    var overrideCurrentContext = {};  
    overrideCurrentContext.Templates = {};  
    overrideCurrentContext.Templates.Item = HideRows;  
             SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCurrentContext); 
    
 
})(); 


function HideRows(ctx) {  
   
 
   	if(ctx.CurrentItem.charoption[0].lookupValue!="test1")        
   	{
             return "";
         }
    return RenderItemTemplate(ctx);
}  
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900