Archive

Archive for July, 2014

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

July 10, 2014 3 comments

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!!!