0

If I custom render my groups on list views with JSLink, I (of course) overwrite the SharePoint standard code, including the javascript for expanding.

function myGrouping(ctx, group, groupId, listItem, listSchema, level, expand) {
        var html = listItem[group] + '<br/>';
        return html;
}

I already tried to copy the default SP js into my code but it won't work. Is there a simple way to expand the group and load the items into the ctx object?

1 Answer 1

1

of the top of my head, don't have acces to my own code library

RenderGroupTemplate(ctx, group, groupId, listItem, listSchema, level, collapse)

returns the standard HTML, you would then use some string functions to work your HTML in there

function mygroupTemplate(ctx, group, groupId, listItem, listSchema, level, collapse) {
    console.info('groupTemplate', group, groupId, level, collapse, listItem, listSchema);
    var H=RenderGroupTemplate(ctx, group, groupId, listItem, listSchema, level, collapse);
    console.info(H);
    return H;
};

or manipluate the listItem object going into that RenderGroupTemplate function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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