Get all Folders in a library using SPServices.
var LibName="";
var folders = "";
function GetLibraryFolders()
{ jQuery().SPServices({
operation: "GetListItems",
listName: LibName,
asunc:false,
completefunc: function (xData, Status) {
jQuery(xData.responseXML).SPFilterNode("z:row").each(function() {
var thisFSObjType = jQuery(this).attr("ows_FSObjType").split(";#")[1];
if(thisFSObjType == 1)
folders = folders+ jQuery(this).attr("ows_LinkFilename")+"\n";
});
}
});
alert(folders );
}
var LibName="";
var folders = "";
function GetLibraryFolders()
{ jQuery().SPServices({
operation: "GetListItems",
listName: LibName,
asunc:false,
completefunc: function (xData, Status) {
jQuery(xData.responseXML).SPFilterNode("z:row").each(function() {
var thisFSObjType = jQuery(this).attr("ows_FSObjType").split(";#")[1];
if(thisFSObjType == 1)
folders = folders+ jQuery(this).attr("ows_LinkFilename")+"\n";
});
}
});
alert(folders );
}
No comments:
Post a Comment