I created a publishing page using the "Blank Web Part Page" layout and when I add a list view web part (programmatically or manually) to this page, the header "Add Document or drag files here" does not display.
Now I can edit the web part to "Show Toolbar" and then it shows the header, but I don't know how to do this programmatically with CSOM and it appears no one else does either.
So I'm trying to find a solution so that when I programmatically add a xslt list view web part to a publishing page the "Add Document or drag files here" will automatically appear.
I've debugged the clienttemplates.debug.js file and I've narrowed it down to the following "ShouldRenderHeroButton" function. The part that is in bold below is my problem. Apparently this variable is undefined. And I'd rather not create my own custom clienttemplates file.
function ShouldRenderHeroButton(renderCtx) {
var listSchema = renderCtx.ListSchema;
return !Boolean(renderCtx.DisableHeroButton) && (!listSchema.IsDocLib || (CanUploadFile(renderCtx) || renderCtx.ListTemplateType == 119 || Boolean(renderCtx.NewWOPIDocumentEnabled))) && listSchema.ListRight_AddListItems != null&& (listSchema.Toolbar == 'Freeform' || typeof window['heroButtonWebPart' + renderCtx.wpq] != 'undefined'&& listSchema.Toolbar == 'Standard');
}
I'd be SOOO thankful if someone could help me out here.