V
V
vendettametal2017-03-26 12:44:01
1C
vendettametal, 2017-03-26 12:44:01

How to color columns in table 1C?

It is necessary to programmatically color a column in the form of a list of documents using a checkbox in the Document Form, how to access these properties correctly, that is, there are two forms, changing the value of the checkbox should change the color of the column in another form, how to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Kinash, 2017-03-26
@Dementor

To begin with, let's consider what the purpose of the forms of the document. The document list form is a visual representation of a set of records in a DBMS table. The form of the document itself is a visual representation of the value of the properties of one particular record in the same DBMS table.
If a checkbox has been placed on the document form, which has nothing to do with the values ​​stored in the DBMS, forget about it. Such a value is not something that cannot be processed on other forms, even when the current form is reopened, it will not be saved (with the exception of autosave in the user settings, but that's a completely different story).
If the checkbox reflects the existence of a real value in a table entry in the DBMS, then it can also be used on the list form. To know how to do this, you need to know the type of forms used - regular (like Visual Studio) or managed(HTML-like). In the first case, the list has events OnOutputString and OnReceiptData - in both options, the values ​​of the properties of output records and settings for their design are available - you can change fonts, background, and so on. In the second case, everything is even simpler and without programming - the form itself has conditional design settings and in the visual designer you can configure how which of the records will look if they contain certain values. In the latter case, changing the conditional design is available not only to programmers in the configurator, but also to ordinary users in the course of their work.

K
Konstantin, 2017-03-26
@fosihas

procedure When Outputting a String (, List Form Event (right-click on the list with select property), you can set the color change

V
vendettametal, 2017-03-27
@vendettametal

I implemented everything as clumsily as possible)

Процедура СписокПриВыводеСтроки(Элемент, ОформлениеСтроки, ДанныеСтроки,ФормаДокумента,ФормаСписка,Флажок1,Колонка1,ДокументПолучен)
         Если ОформлениеСтроки.Ячейки.Колонка1.Текст = "Полученны" Тогда 		
    
ОформлениеСтроки.Ячейки.Колонка1.ЦветФона = WebЦвета.БледноЗеленый;
  Иначе 
    
    ОформлениеСтроки.Ячейки.Колонка1.ЦветФона = WebЦвета.Красный;
  КонецЕсли
       
КонецПроцедуры

And the checkbox in the document changes the text to "received"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question