2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【kintone カスタマイズ】 印刷画面の全てのラベルを非表示にする

Last updated at Posted at 2022-03-31

印刷画面の全てのラベルを非表示にする

kintoneのラベルは「フィールドコード」を持ち合わせていないため、DOM操作による非表示が必要になります。 下記のコードではラベルに付与されるクラス名からラベル要素を全て取得し、その後非表示する処理を行っています。

js
(function () {
    "use strict";
    // 印刷画面が表示されたときに動作
    kintone.events.on('app.record.print.show', function(event) {
        //ラベルの非表示('control-label-field-gaia')
        let labels = document.getElementsByClassName('control-label-field-gaia ');
        for (let i = 0; i < labels.length; i++) {
            let label = labels[i];
            let parent = label.parentNode;
            label.style.display = 'none';
            parent.style.display = 'none';
        }
        return event;
    });
})();

罫線の非表示はこちらをご覧ください

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?