iOS Question B4Xtable - text is truncated with "..."

voxel

Member
Licensed User
Hello,
On a B4Xtable table, how to display all the content of a text in a cell because currently the text is truncated with "...". On my B4A code, I don't have this behavior.
Thanks for your help.
 

voxel

Member
Licensed User
I specify my question, under B4A, the text is automatically put in multiline in the cell. But with B4I, the same text displays "..." in the cell.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Dim NamesColumn As B4XTableColumn = B4XTable1.AddColumn("Name", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("State", B4XTable1.COLUMN_TYPE_TEXT)
    B4XTable1.MaximumRowsPerPage = 20
    B4XTable1.BuildLayoutsCache(B4XTable1.MaximumRowsPerPage)
    For i = 1 To NamesColumn.CellsLayouts.Size - 1
        Dim pnl As B4XView = NamesColumn.CellsLayouts.Get(i)
        pnl.GetView(NamesColumn.LabelIndex).As(Label).Multiline = True
    Next

1658205450711.png
 
Upvote 0

voxel

Member
Licensed User
Thank you, I tried this code but I have the same problem with column "Paramètre"

B4X:
    TabAnalyse.BuildLayoutsCache(TabAnalyse.MaximumRowsPerPage)
    
            NumberColumn=TabAnalyse.AddColumn("Paramètre", TabAnalyse.COLUMN_TYPE_TEXT)
            'NumberColumn.Width = 160dip
            
            For i = 1 To NumberColumn.CellsLayouts.Size - 1
                Dim pnl As B4XView = NumberColumn.CellsLayouts.Get(i)
                pnl.GetView(NumberColumn.LabelIndex).As(Label).Multiline = True
            Next
            
        
            TabAnalyse.AddColumn("Mesure", TabAnalyse.COLUMN_TYPE_TEXT).Width = 80dip
            TabAnalyse.AddColumn("Référence", TabAnalyse.COLUMN_TYPE_TEXT).Width = 80dip
            TabAnalyse.AddColumn("Limite", TabAnalyse.COLUMN_TYPE_TEXT).Width = 80dip
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
No.

First add all columns.

Only then call BuildLayoutsCache.

B4X:
Dim col1 As B4XTableColumn = TabAnalyse.AddColumn("Mesure", TabAnalyse.COLUMN_TYPE_TEXT)
col1.Width = 80dip
Dim col2 As B4XTableColumn = ...
col2.Width = 80dip

TabAnalyse.BuildLayoutsCache(TabAnalyse.MaximumRowsPerPage)
For Each col As B4XTableColumn In Array(col1, col2) 
For i = 1 To col .CellsLayouts.Size - 1
                Dim pnl As B4XView = col .CellsLayouts.Get(i)
                pnl.GetView(col .LabelIndex).As(Label).Multiline = True
   Next
Next
 
Upvote 0

voxel

Member
Licensed User
I try, but same problem.

B4X:
'entete du tableau
            TabAnalyse.HeaderFont = xui.CreateDefaultBoldFont(12)
            TabAnalyse.HeadersHeight=25dip
            
            Dim col1 As B4XTableColumn=TabAnalyse.AddColumn("Paramètre", TabAnalyse.COLUMN_TYPE_TEXT)
            col1.Width = 160dip
        
            Dim col2 As B4XTableColumn=TabAnalyse.AddColumn("Mesure", TabAnalyse.COLUMN_TYPE_TEXT)
            col2.Width = 80dip
            
            Dim col3 As B4XTableColumn= TabAnalyse.AddColumn("Référence", TabAnalyse.COLUMN_TYPE_TEXT)
            col3.Width = 80dip
            
            Dim col4 As B4XTableColumn= TabAnalyse.AddColumn("Limite", TabAnalyse.COLUMN_TYPE_TEXT)
            col4.Width = 80dip
            
            TabAnalyse.BuildLayoutsCache(TabAnalyse.MaximumRowsPerPage)
            
            For Each col As B4XTableColumn In Array(col1,col2,col3,col4)
                For i = 1 To col .CellsLayouts.Size - 1
                    Dim pnl As B4XView = col .CellsLayouts.Get(i)
                    pnl.GetView(col .LabelIndex).As(Label).Multiline = True
                Next
            Next
            
            'alimentation des données dans le tableau
            TabAnalyse.SetData(data)
 
Upvote 0

voxel

Member
Licensed User
There is a side effect, this function no longer works, there is no longer any coloring of the lines.

B4X:
Sub TabAnalyse_DataUpdated
    For i = 0 To TabAnalyse.VisibleRowIds.Size - 1
        Dim RowId As Long = TabAnalyse.VisibleRowIds.Get(i)
        If RowId > 0 Then
            'criteria
            Dim Value As String = TabAnalyse.GetRow(RowId).Get(NumberColumn.Id)
            If Value.Contains("# ") Then
                SetRowColor(i, xui.Color_RGB(255,153,0)) 'couleur orange
                Continue
            End If
            If Value.Contains("! ") Then
                SetRowColor(i, xui.Color_Red)
                Continue
            End If
            If Value.Contains("> ") Then
                SetRowColor(i, xui.Color_RGB(145,220,90))
                Continue
            End If
        End If
        If i Mod 2 = 0 Then
            SetRowColor(i, TabAnalyse.EvenRowColor)
        Else
            SetRowColor(i, TabAnalyse.OddRowColor)
        End If
    Next
End Sub
 
Upvote 0
Top