I am trying to create a new list (based on a dropdown menu selection) using JavaScript Client Side Object Model.
var typeList = "SP.ListTemplateType." +listTemplateType;
listCreationInfo.set_templateType(typeList);
The value of variable "listTemplateType" is from the dropdown control.
The problem is that these values are the normal list template values such as "Announcements", "DocumentLibrary" and etc. And these values give an error "input format is not correct".
E.g listCreationInfo.set_templateType(SP.ListTemplateType.DocumentLibrary);
However when I enter the SP.ListTemplateType
enums (http://msdn.microsoft.com/en-us/library/office/ee549420%28v=office.14%29.aspx) such as announcements
,documentLibrary
etc, the list is created successfully.
E.g listCreationInfo.set_templateType(SP.ListTemplateType.documentLibrary);
I am also not able to find a property to obtain these enums -
http://msdn.microsoft.com/en-us/library/office/jj247105%28v=office.15%29.aspx
Is there any way to get all the SP.ListTemplate types using an existing SP.ListTemplate method or property? Methods such as get_listTemplateTypeKind() are not giving the desired values in the correct format.