Help us understand the problem. What is going on with this article?

【SharePoint 2013】SharePoint のビューでリストIDをゼロパディングして表示する。

More than 1 year has passed since last update.

[JS リンク]を使用する

ビューでページの編集から、表示を変更したいリストの [Web パーツの編集] で [JS リンク] に js ファイルを指定します。

(function () {
  var ctx = {};
  ctx.Templates = {};
  ctx.Templates.Fields = {
    'ID': {
      'View': function (ctx) {
        var num = ctx.CurrentItem.ID;
        return ('000' + num).slice(-4);
      },
    }
  };

  SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctx);
})();

[集計値]列を使用する※

[集計値]列を作成して、[数式]を指定します。

例)
="ID-"&TEXT(ID,"0000")

※列の設定時にはうまくいきますが、アイテムを編集したりすると'“0”になってしまう不具合があるようです。
WS000007+%25282%2529[1].JPG

参考サイト

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした