Using Box UI Content Explorer: Can I change the name of the folder that is presented on the UI ?
Hello:
We are using the Box UI Content Explorer version: https://cdn01.boxcdn.net/platform/elements/6.0.0/en-US/explorer.js. Is it possible to modify the name of folders that are presented on the UI ?
I know I can modify the "Modified Date" and "Modified By" by adding the event below:
Sample event listener:
var modifyResponse = function (response) {
if ((response.config.method == 'get') && (response.data.item_collection != null)) {
var listOfData = [];
for (var i in response.data.item_collection.entries) {
//if (response.data.item_collection.entries[i].modified_by.name.trim() == getBoxAccountDefaultUser().trim()) {
// response.data.item_collection.entries[i].modified_by.name = getORISDefaultUser();
//}
//Get ORIS Box Info
var simpleData = {
FileName: response.data.item_collection.entries[i].name,
DocData: getDocAssociatedData(),
ModifiedDate: response.data.item_collection.entries[i].modified_at,
ModifiedBy: response.data.item_collection.entries[i].modified_by.name,
FileId: response.data.item_collection.entries[i].id
};
//getMetaData(simpleData);
//var orisResponse = getORISResponse();
//response.data.item_collection.entries[i].modified_at = orisResponse["ModifiedDate"];
//response.data.item_collection.entries[i].modified_by.name = orisResponse["ModifiedBy"];
//Add to list
listOfData.push(simpleData);
}
getMetaDataList(listOfData);
var listRetData = getORISResponse();
for (var i in response.data.item_collection.entries) {
var metaData = findSimpleMeta(listRetData, response.data.item_collection.entries[i].id);
response.data.item_collection.entries[i].modified_at = metaData["ModifiedDate"];
response.data.item_collection.entries[i].modified_by.name = metaData["ModifiedBy"];
}
}
return response;
}
contentExplorer.show(folderId, kk, {
container: '.container',
logoUrl: 'box',
defaultView: 'files',
canRename: false,
canCreateNewFolder: false,
canShare: false,
canSetShareAccess: false,
canPreview: true,
canDownload: true,
canDelete: getCanDelete(),
canUpload: getCanUpload(),
requestInterceptor: addExtraHeaders,
responseInterceptor: modifyResponse,
sortBy: 'modified_at',
sortDirection: 'DESC',
size: 'small'
});
Thank you
Mila
Please sign in to leave a comment.
Comments
0 comments