Skip to main content
added 409 characters in body
Source Link
Rob Windsor
  • 12.7k
  • 26
  • 40

You can access the members of an enumeration (or any JavaScript object for that matter) using the C# indexer syntax. So the code you want would be something like:

var typeList = SP.ListTemplateType["announcements"];
listCreationInfo.set_templateType(typeList);

You can use a for loop to iterate all of the property values of the enumeration.

var message = $('#message');
message.text("SP.ListTemplateType members");
for (var prop in SP.ListTemplateType) {
    var value = SP.ListTemplateType[prop];
    if (typeof value == "number") {
        message.append("<br/>");
        message.append(prop + " " + value);
    }
}

You can access the members of an enumeration (or any JavaScript object for that matter) using the C# indexer syntax. So the code you want would be something like:

var typeList = SP.ListTemplateType["announcements"];
listCreationInfo.set_templateType(typeList);

You can access the members of an enumeration (or any JavaScript object for that matter) using the C# indexer syntax. So the code you want would be something like:

var typeList = SP.ListTemplateType["announcements"];
listCreationInfo.set_templateType(typeList);

You can use a for loop to iterate all of the property values of the enumeration.

var message = $('#message');
message.text("SP.ListTemplateType members");
for (var prop in SP.ListTemplateType) {
    var value = SP.ListTemplateType[prop];
    if (typeof value == "number") {
        message.append("<br/>");
        message.append(prop + " " + value);
    }
}
Source Link
Rob Windsor
  • 12.7k
  • 26
  • 40

You can access the members of an enumeration (or any JavaScript object for that matter) using the C# indexer syntax. So the code you want would be something like:

var typeList = SP.ListTemplateType["announcements"];
listCreationInfo.set_templateType(typeList);