Get List items, fields names, column names dynamically

Apr 15, 2015 at 9:25 AM
Hi All,
I am building a custom mobile UI for sharepoint 2010 site using spservices.
It works very good, I'm getting all lists name and user information. I build a menu that holds all the lists names and url, when the user is clicking on a list url, the page is refreshing with each list items.

The problem I have is I dont want to write all fields name manually in spservices since there are so many list on the site. I would love to know how to code spservices so it pull all column names based on the default view and all items from that list with out adding fields names manually.
$j('#cd-sp-lists li a').click(function(){
    $j("#status").fadeIn('fast');       
    $j("#preloader").fadeIn('fast'); 
    $j('#page').empty();
    var ListGUID = $j(this).attr('title');  

        $j().SPServices({
            operation: "GetListItems",
            async: false,
            listName: '' + ListGUID + '',               
            CAMLViewFields: "<ViewFields><FieldRef Name='TeamProfilePhoto' /></ViewFields>",
            completefunc: function (xData, Status) {
              $j(xData.responseXML).SPFilterNode("z:row").each(function() {

                var liHtml = "<li>" + $j(this).attr("ows_TeamProfilePhoto") + "</li>";      

                $j("#page").append(liHtml); 
                $j('#sp-lists').removeClass('is-visible');                  
                $j("#status").delay(1000).fadeOut(); 
                $j("#preloader").delay(1000).fadeOut("normal"); 
              });
            }
          });   
        return false;           
    });
It would be awesome if someone has done it before and can show me how. I'll really appreciated.
Thanks
Coordinator
Apr 15, 2015 at 2:18 PM
Not fully, but take a look at GetListItemsSinceToken or SPGetListItemsJson.

M.
Apr 20, 2015 at 10:44 AM
Can you please show me an example?
Coordinator
Apr 29, 2015 at 1:59 PM
Did you look at the two functions I mention above? There are examples in the docs.

M.