Home > Microsoft SharePoint, SharePoint2013 > SharePoint 2013: Item template not called in JSLink with group rendering

SharePoint 2013: Item template not called in JSLink with group rendering

Hi Friends,

I have explained the Group rendering with JSLink in one my previous blog. I will explain a common problem and a solution for that while group rendering with JSLink.

Scenario:

While rendering grouping in view with JSLink, We normally face an issue that item rendering handler ‘overrideCtx.Templates.Item’ is not getting called. Group rendering was working fine in my case but not item level rendering.

Solution:

Initially I thought something wrong with JSLink file but after analysing and debugging I found the problem is with the grouping configured in data view.

To fix this issue edit your data view and go to grouping section of the view. Change ‘By default, show groupings’ setting to ‘Expanded’ and save the view and bingo it will start working.

Following image shows the setting in data view –

JSLink Group

JSLink Group

If you are provisioning data view declaratively then you need to add Collapse=”FALSE” to your <GroupBy node.

JSLink_Group1

Possible reason for this problem is, while the groups shown in collapsed state item in that group are not loaded initially and once you click to expand the group it will be loaded on demand hence item template not gets called initially as items not loaded.

Hope this will help some of the developer looking for same kind of answer.

Happy coding!!!

Advertisements
  1. Nate
    March 17, 2015 at 8:54 pm

    YOU ARE AWESOME!!!! I was searching all over for this issue and found this! Thanks so much for the post!!!

  2. February 25, 2016 at 8:03 pm

    Thanks a lot! I tougth it was jslink problems

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: