This project has moved and is read-only. For the latest updates, please go here.

display all lists in a particular site collection

Sep 25, 2014 at 12:59 AM
I have a req to display all possible lists on a single page in SP

so far this is the only code which sorta works

           completefunc: function(xData, Status) {
                   listNames = $(this).attr("Title");
1) it shows all type of lists even document type list , all I want it to show or display is
the custom list which I have created and once i create a new list it should show that on the same page

Sep 25, 2014 at 10:36 AM
What you get back from GetListCollection gives you enough info to go on. You'll want to filter on the ServerTemplate attribute for the type of list you want to display.

For instance, if you want just the Custom Lists:
var p = $().SPServices({
p.done(function() {
    var listName = $(this).attr("Title");
    if($(this).attr("ServerTemplate") === "100") {
Note that I've switched to using a promise so that the request won't tie up the browser.

Sep 25, 2014 at 10:34 PM
Edited Sep 25, 2014 at 11:17 PM
Thanks M it worked

I know how to add an hyperlink to the display list(s) , but I what i want is when the user clicks on the hyperlink it should take the user to that particular list

var liHtml = "<li><a href='" + listNames + "'>" + listNames + "</a> </li>";
will using the GUID help ?

never mind . I figured it out

var list_URL = $(this).attr("DefaultViewUrl");

thanks for all you help
Sep 28, 2014 at 9:58 AM
No problem. I'm glad you figured it out.