This code works but creates a million tables.......
<script language="javascript" type="text/javascript"> var newListName; //loop through all lists to get the listNames $(document).ready(function() { $().SPServices({ operation:"GetListCollection", async:false, completefunc: function(xData, Status) { $(xData.responseXML).find("List[ServerTemplate='101']").each(function(){ listName = $(this).attr("Title"); //While looping through the lists pass the listName to the GetListItems operation to get details about the list items $().SPServices({ operation: "GetListItems", async: false, listName: listName, CAMLViewFields: "<ViewFields>><FieldRef Name='Name'/><FieldRef Name='FileSizeDisplay'/><FieldRef Name='Modified'/></ViewFields>", CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='Recursive'/></QueryOptions>", completefunc: function (xData, Status) { $(xData.responseXML).SPFilterNode("z:row").each(function() { var liHtml=""; if(listName!=newListName) { newListName = listName; liHtml = listName + "<br><table border='1' id='myTable'><tr><td>File Name</td><td>File Size</td><td>Last Modified</td></tr><tr><td width='200px'>" + $(this).attr("ows_FileLeafRef") + "</td><td>" + $(this).attr("ows_FileSizeDisplay") + "</td><td>" + $(this).attr("ows_Modified") + "</td></tr></table>"; } else { liHtml = "<table border='1'><tr><td>" + $(this).attr("ows_FileLeafRef") + "</td><td>" + $(this).attr("ows_FileSizeDisplay") + "</td><td>" + $(this).attr("ows_Modified") + "</td></tr></table>"; } $("#myDiv").append(liHtml); }); // end each } // end completefunc }); // end spservices }); // end each } // end completefunc }); // end spservices }); // end ready function </script> <div id="myDiv"/> Thanks,
Dan
<script language="javascript" type="text/javascript"> var newListName; //loop through all lists to get the listNames $(document).ready(function() { $().SPServices({ operation:"GetListCollection", async:false, completefunc: function(xData, Status) { $(xData.responseXML).find("List[ServerTemplate='101']").each(function(){ listName = $(this).attr("Title"); //While looping through the lists pass the listName to the GetListItems operation to get details about the list items $().SPServices({ operation: "GetListItems", async: false, listName: listName, CAMLViewFields: "<ViewFields>><FieldRef Name='Name'/><FieldRef Name='FileSizeDisplay'/><FieldRef Name='Modified'/></ViewFields>", CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='Recursive'/></QueryOptions>", completefunc: function (xData, Status) { $(xData.responseXML).SPFilterNode("z:row").each(function() { var liHtml=""; if(listName!=newListName) { newListName = listName; liHtml = listName + "<br><table border='1' id='myTable'><tr><td>File Name</td><td>File Size</td><td>Last Modified</td></tr><tr><td width='200px'>" + $(this).attr("ows_FileLeafRef") + "</td><td>" + $(this).attr("ows_FileSizeDisplay") + "</td><td>" + $(this).attr("ows_Modified") + "</td></tr></table>"; } else { liHtml = "<table border='1'><tr><td>" + $(this).attr("ows_FileLeafRef") + "</td><td>" + $(this).attr("ows_FileSizeDisplay") + "</td><td>" + $(this).attr("ows_Modified") + "</td></tr></table>"; } $("#myDiv").append(liHtml); }); // end each } // end completefunc }); // end spservices }); // end each } // end completefunc }); // end spservices }); // end ready function </script> <div id="myDiv"/> Thanks,
Dan