Sharepoint 列表';由'创建;编队

Sharepoint 列表';由'创建;编队,sharepoint,sharepoint-2010,survey,Sharepoint,Sharepoint 2010,Survey,我知道有surveylist.get_description和surveylist.get_itemCount。我想知道是否有一种方法可以通过fit在列中创建?根据语法,我猜您使用的是Javascriot CSOM。 试试这个: surveylist.get_author 不要忘记,在获取属性值之前,您需要明确指定要检索的属性。不幸的是,该属性未通过SharePoint CSOM公开 如何通过CSOM检索列表作者属性? 其思想是检索和提取Author属性 function getListAut

我知道有
surveylist.get_description
surveylist.get_itemCount
。我想知道是否有一种方法可以通过fit在列中创建?

根据语法,我猜您使用的是Javascriot CSOM。 试试这个:

surveylist.get_author
不要忘记,在获取属性值之前,您需要明确指定要检索的属性。

不幸的是,该属性未通过SharePoint CSOM公开

如何通过CSOM检索列表作者属性? 其思想是检索和提取Author属性

function getListAuthor(listTitle,OnSuccess,OnError) {

    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle(listTitle);

    context.load(web);
    context.load(list,'SchemaXml');

    context.executeQueryAsync(function(sender,args){

        var schemaXml = $.parseXML(list.get_schemaXml());
        var authorId = parseInt($(schemaXml).find('List').attr('Author')); //SchemaXml contains Author ID only 

        var listAuthor = web.getUserById(authorId);
        context.load(listAuthor);
        context.executeQueryAsync(OnSuccess(listAuthor),OnError);

    },OnError);        
}



//Usage

getListAuthor('Discussions List',
function(author){
    console.log('List created by: ' + author.get_loginName())
},
function(sender,args){
    console.log('Error occured:' + args.get_message());
}
);

不清楚你在问什么。如果有调查列表。get_createdBy(似乎不是那样的工作方式)。不是那样的工作方式。我将在稍后发布脚本。