1

Any ideas on how to return from the Custom Item method when using JSLink (as if it was never called)? I want to do a check in this method and hide the row if the condition fails. I know I can do a PostRender, but then I will have to loop through each row again.

overrideContext.Templates.Item = customItem;

function customItem(context) {
   if(conditionIsNotMet)
      return context.ListData.Row;
   else
      //Hide Row somehow

   //Tried return context.CurrentItem, return null, return "", return context.ListData
}
1

Have you seen this post: Filter out items in list view using jslink

Looks like you could do:

overrideContext.Templates.Item = customItem;

function customItem(context) {
   if(conditionIsNotMet) {
      return RenderItemTemplate(context);
   }
   else {
      return '';  //Hide Row somehow
   }     
}

HTH

1
  • Thanks for the reply Robin. That post was helpful but what did the trick was RenderItemTemplate(context); I have made the edit. Thanks again – Michael Colbs Jul 22 '14 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.