This article explains how to update a folder in a Document Library in SharePoint 2013 using CSOM-JavaScript.
IntroductionThis article explains how to update a folder in a Document Library in SharePoint 2013 using CSOM-JavaScript.
Prerequisites
Use the following procedure:
var context = SP.ClientContext.get_current(); //gets the current context
var web = context.get_web(); //gets the web object
var list = web.get_lists(); //gets the collection of lists
var targetList;
var itemCreation;
function updateFolder() {
targetList = list.getByTitle("MyDocumentLibrary"); //gets the doc lib object
var itemUpdate = targetList.getItemById(1); //get the item object to update
itemUpdate.set_item("FileLeafRef", "My updated folder");
//update the field.
itemUpdate.update();
context.load(itemUpdate);
context.executeQueryAsync(onFolderUpdateSuccess, onFolderUpdateFail);
}
Testing
SummaryThus in this article you saw how to update the folder in a Document Library in SharePoint 2013 using CSOM-JavaScript.
SharePoint 2013 Administration Essentials