ホーム AI・IT Color-coding Statuses on kintone Detail Screens | CSS Tips

Color-coding Statuses on kintone Detail Screens | CSS Tips

藤崎 健人 藤崎 健人 • 更新: • 公開: • 読了約 6 分
目次
ncb8f42bb27b2
Is your status information getting buried?

When managing inventory or projects in kintone, you often encounter situations where multiple statuses are displayed on the detail screen. However, if this information is not visually distinguished, it becomes difficult to determine at a glance which information is important.

This is where color-coding statuses using CSS comes in handy. By using JavaScript to evaluate conditions and assign corresponding CSS classes, you can change the appearance based on priority.

Implementation PointsThe mechanism consists of 3 steps

・Event Catching: Use the 'app.record.detail.show' event when the detail screen is displayed

・Value Retrieval and Evaluation: Retrieve the status field value with JavaScript and use if-statements for conditional branching

・Class Assignment: Dynamically add CSS classes using 'classList.add()'

・Styling with CSS: Visually emphasize with background colors or left borders (using '!important' is key)

The code can be completed in under 20 lines

It features a concise implementation suitable for programming beginners. You can set different background colors and borders for each status, such as green for 'In Stock' and red for 'Out of Stock'.

Easy to set up

Simply select 'JavaScript/CSS Customization' from the kintone app settings, paste the code, and save. No complex environment setup is required.

Can be applied to multiple fields

Even if you have multiple status fields such as 'Shipping Status' or 'Priority', you can handle them by simply repeating the same logic.

Making kintone even easier to use

This customization significantly improves the readability of the detail screen. Users can quickly grasp important information, leading to improved operational efficiency. Since CSS color settings are also customizable, it is easy to align them with your organization's color scheme rules.

⸻

This article is an excerpt from a Kintune blog post. Read the full article (with diagrams and code) here → https://kintune-ai.com/blog/kintonecss-1

Originally published: https://kintune-ai.com/blog/kintonecss-1

同じカテゴリの記事

藤崎 健人

芸能取材歴10年のデスク。所属事務所の公式リリース、番組公式サイト、配信サービスの告知を一次情報として採用し、裏付けの取れない内容は記事にしていません。

おすすめの関連記事