I am following GitHub - zhihailiu/alfresco-folder-size: Alfresco folder size to calculate the folder size and its working fine,that is the folder size is showing as a separate component alongwith the properties of the folder but now I also want to show the size in the document library of the folder.the following link contains the code
when I am trying to access the variable size outside the jsonGet method,it is showing undefined that is the default value of size
but after searching on internet,I learned that jsonGet is asynchronous,so it is exceuted after the synchronous code.so,I replaced the jsonGet method with $.ajax method and set the async to false to make $.ajax synchronous and access the variable outside the jsonGet method.but,still the variables "size" is undefined.
any help would be greatly appreciated.I am trying dis from many days
Hi, Ayushi Agrahatri
Please try by Initialize the variable size,
var size = 0;
If you are calling a printSize() function then you can pass your size variable in that function
printSize(size);
And you can get it in your function
function printSize(folderSize)
{
console.log(folderSize)
}
Thanks,
Kalpesh
Yupp thanks for dis but I am actually trying to execute the last html statement inside the printsize function so as to show the size of folder in document library but after a little testing,I get to know that html statement is executed properly if it remains only inside the renderer function and not in any other function(e.g. even not inside the printsize function)
How to execute that html statement with size having the value that is manipulated inside the ajax function rather than the default value.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.