LOL
"I wish client side development would just go away" might not be the best comment when you are trying to get help on client side coding from a community of folks that may actually like client side coding. :)
Although you may be a C# developer, you have managed to hack together some pieces of code to generate HTML. You are not far off... jQuery .each() is a looping function (similar to C# foreach) and thus if you are generating a
I think you are trying to loop through all document libraries and then for each one you want to show a table with the list of files along with some file information for each... So your code design (yes, do that too in client side development) would be
Hope this helps... Good luck
"I wish client side development would just go away" might not be the best comment when you are trying to get help on client side coding from a community of folks that may actually like client side coding. :)
Although you may be a C# developer, you have managed to hack together some pieces of code to generate HTML. You are not far off... jQuery .each() is a looping function (similar to C# foreach) and thus if you are generating a
<Table>
tag inside the loop you are going to get as many tables as there are iterations through the loop. I think you are trying to loop through all document libraries and then for each one you want to show a table with the list of files along with some file information for each... So your code design (yes, do that too in client side development) would be
- initiate the variable that will store the html markup
- Get List of Document Libraries.
-
Loop through each Document library and for each one, do the following (in this order):
a. Add the name of the list to the variable that is storing the HTML (From Step 1) - example:<h3>list Name</h3>
b. Add the Table markup and header row to the variable that is holding the html markup (<table><tr><th>column1</th><th>colomn2</th></tr>
)
c. Get a list of all files from this document library
d. Loop through the list of files and append the rows to the variable holding the html markup (<tr><td>column1 values</td><td>column2 value</td></tr>
) to content you generated in step 2.b.
e. Close the table markup that was started in 2.b (</table>
). -
When we are all done with looping through all document libraries (#4) and getting all files for each document library (4.d), add the html markup to the page (
$("#myDiv").append(something)
Hope this helps... Good luck