Skip to content

'assets/js/integram-table.js Форматировать subordinate-cell-clickable в табличном реквизите согласно типу данных'#277

Merged
ideav merged 3 commits intomainfrom
issue-276-1f72d2d4bb8c
Feb 7, 2026

Conversation

@konard
Copy link
Copy Markdown
Collaborator

@konard konard commented Feb 7, 2026

🎯 Summary

This pull request fixes the formatting of the first column in subordinate tables (табличные реквизиты) by applying proper type-based formatting according to metadata.

📋 Issue Reference

Fixes #276

🔧 Changes Made

Problem

The first column in subordinate tables (.subordinate-cell-clickable) was always displayed as plain text, regardless of its data type. For example:

  • DATE fields showed raw values instead of formatted dates (dd.mm.yyyy)
  • DATETIME fields weren't formatted properly (dd.mm.yyyy hh:mm:ss)
  • BOOLEAN fields showed 0/1 instead of Да/Нет

Root Cause

In renderSubordinateTable() at line 3217, the code was passing null as the type parameter to formatSubordinateCellValue():

const displayMainValue = this.formatSubordinateCellValue(mainValue, null);

This meant the formatting logic couldn't determine the proper format for the value.

Solution

Modified the code to pass metadata type information:

const mainFieldInfo = { type: metadata.type };
const displayMainValue = this.formatSubordinateCellValue(mainValue, mainFieldInfo);

Now the first column is formatted according to its type ID from metadata, using the same logic that already works for other columns in subordinate tables.

🧪 Testing

The fix leverages existing formatting logic that already works correctly:

  • Other columns in subordinate tables (line 3231) already receive type information and format correctly
  • The formatSubordinateCellValue() method has proven formatting logic for DATE, DATETIME, BOOLEAN types
  • Type mapping is defined in getFormatById() according to TABLE_COMPONENT_README.md

📝 Technical Details

Type Mapping (from TABLE_COMPONENT_README.md):

  • Type 9 → DATE → dd.mm.yyyy
  • Type 4 → DATETIME → dd.mm.yyyy hh:mm:ss
  • Type 11 → BOOLEAN → Да/Нет
  • Type 3 → SHORT → plain text
  • Type 8 → CHARS → plain text
  • Type 12 → MEMO → plain text (with wrapping)
  • Type 13 → NUMBER → right-aligned
  • Type 14 → SIGNED → right-aligned

Files Modified:

  • assets/js/integram-table.js - Added type parameter to first column formatting in subordinate tables

🤖 This PR was created by the AI issue solver

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #276
@konard konard self-assigned this Feb 7, 2026
Pass metadata type information to formatSubordinateCellValue() for the
first column in subordinate tables. This ensures proper formatting based
on the column's data type (e.g., DATE displays as dd.mm.yyyy, DATETIME
as dd.mm.yyyy hh:mm:ss, BOOLEAN as Да/Нет, etc.).

Previously, the first column was always rendered as plain text because
null was passed as the type parameter. Now it receives { type: metadata.type }
which allows the existing formatting logic to work correctly.

Fixes #276

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review February 7, 2026 10:20
@konard konard changed the title [WIP] assets/js/integram-table.js Форматировать subordinate-cell-clickable в табличном реквизите согласно типу данных 'assets/js/integram-table.js Форматировать subordinate-cell-clickable в табличном реквизите согласно типу данных' Feb 7, 2026
@konard
Copy link
Copy Markdown
Collaborator Author

konard commented Feb 7, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.452082 USD
  • Calculated by Anthropic: $1.656104 USD
  • Difference: $0.204022 (+14.05%)
    📎 Log file uploaded as Gist (582KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@ideav ideav merged commit 66308ec into main Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants