LoginSignup
1
0

More than 5 years have passed since last update.

JSCOM (JavaScript Client Side Object Model) メモ

Last updated at Posted at 2018-01-21

色々と忘れるので個人的メモ

リストのパスを取得

(function () {
    var ctx = new SP.ClientContext('{your site path}');

    var lists = ctx.get_web().get_lists();
    ctx.load(lists, "Include(RootFolder.ServerRelativeUrl)");

    ctx.executeQueryAsync(
        function(){
            var enumLists = lists.getEnumerator();
            while(enumLists.moveNext()) {
                var current  = enumLists.get_current();
                console.log(current.get_rootFolder().get_serverRelativeUrl());
            }
        },
        function(sender , args) { console.log(args); }
    );
})();

リスト全件のパスを取得している。

ctx.load(lists, "Include(RootFolder.ServerRelativeUrl)");

RootFolder から取るのをよく忘れるのでメモ。
あと、なにげに getEnumerator の使い方も忘れる。

CAML Query

別で纏めている

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0