1

When you execute a query on a List that is a Document Library, ListItems have a File member that is not populated. Obviously the query doesn't pull in all data by default for performance reasons, but I can't figure out a way to tell the query to populate the File Member, since the query syntax is generic for all Lists and only Document Libraries contain files in them.

4

2 に答える 2

0

このサンプルコードはあなたを助けるはずです:

    var ctx = SP.ClientContext.get_current();

    var itemFile = ctx.get_web().get_lists().getByTitle("Shared Documents").getItemById(1).get_file();

    ctx.load(itemFile);

    ctx.executeQueryAsync(function(){

    console.log(itemFile.get_title());

    },function(sender,args){

    console.log(args.get_message());

    });
于 2013-07-28T15:08:02.413 に答える