TreeGrid v6.0

Text,  Lines and Pass types

TreeGrid documentation index

 

The Text and Lines types are basic cell types to display editable texts.

They cannot contains HTML tags to display – the < and & characters are automatically escaped.

 

Text type

Text type is default cell type and shows a text in the cell in one line.

It is edited in <input> tag.

When it is longer than cell width, it is not wrapped to more lines, but it is overflowed.

It is not possible to set or input CR/LF (Enter) characters into the text.

 

Lines type

Lines type shows a text in the cell in one or more lines.

It is edited in <textarea> tag.

It is automatically wrapped if the text is longer than cell width, but only if it contains white spaces or other characters to wrap on.

It is possible enter CR/LF (Enter) characters into the text if set AcceptEnters=’1’.

To put CR/LF into XML into cell value, use &#x0a; XML entity.

 

Pass type

Special type without any formatting to input password.

It does not show the entered value.

To server are passwords sent not coded!

 

<C> <cell>        string    Type             [“Text”]              Type=”Text” or “Lines”                                                                                                .

To define Text type, set column or cell attribute Type to “Text”, for Lines type set Type to “Lines

 

<Cfg><C><cell> bool AcceptEnters    [0]                                                                                                                                              .

For Lines type cell to let input CR/LF character into cell.

For 0 the Enter key accepts changes and finishes editing like in single line text.

For 1 the Enter key inputs LF character (&#x0A). To finish editing is possible by Alt+Enter or Ctrl+Enter or click outside the cell.

 

<C> <cell>        string    EmptyValue      [“”]                                                                                                                                new 6.0 .

The string displayed when the text empty.

It is shown only for display, not for edit.

It is not escaped, it can contain HTML code.

 

<C> <cell>        string    Format                                                                                                                                                         chg 6.4 .

Specifies text format – how the text will be modified for display.

It is usually not required to use it.

 

Syntax: |LetterType|Prefix|Postfix|Search|Flags|Replace

             ‘|’ is any character not contained in any section to separate section values. Remember, it must be the first character in the format.

             ‘LetterType’ is number specifies case conversion: 0 – none, 1 – lowercase, 2 – uppercase, 3 – locale lowercase, 4 – locale uppercase

             ‘Prefix’ is string added before value

             ‘Postfix’ is string added after value

             ‘Search’ is RegExp string to replace it for ‘Replace’ string. This runs before LetterType conversion. ‘Flags’ are flags for RegExp, any of ‘g’, ‘i’, ‘m’.

Since 6.4 the Replace string is not escaped when NoFormatEscape=’1’

In Prefix and Postix is not possible to use HTML tags except NoFormarEscape is set. To format the value by HTML tags rather use cell attributes HtmlPrefix and HtmlPostfix instead.

Remember, the Format is applied also when sorting, grouping, filtering or searching.

 

<Cfg>                bool       NoFormatEscape    [0]                                                                                                                    chg 6.0 .

If set to “”, it means 0 for text and 1 for number and date.

If set to 0, the Format Prefix and Postfix is escaped, so the characters & and < are displayed as they are.

If set to 1, you can use HTML tags in columns Format string, in prefix and postfix for text and anywhere for numbers.

 

<C>                   int          VarHeight            [0]                                                                                                                                 new 7.0 .

Set to columns containing wrap able cells, to shrink row height when the column is resized by a user and cells values occupy less height.

For 1 the rows are resized after column resizing finishes.

For 2 it resizes the rows during column resizing, it can be slow and should be used only for small grids.