Android Question B4XTable - B4XTable1.SearchField.TextField.Enabled = False did not work

GMan

Well-Known Member
Licensed User
Longtime User
I have a B4XTable and the setting
B4X:
    B4XTable1.SearchField.TextField.Enabled = False
does not work.
The TopRow with the arrows ( |< < {number} > >| ) AND the Search textfield is shown though.

Has anyone a solution ?
 

GMan

Well-Known Member
Licensed User
Longtime User
Thx for the hint, but doesnt work


B4X:
    B4XTable1.AllowSmallRowHeightModifications = False
    B4XTable1.RowHeight = 120dip
    Sleep(0)
    B4XTable1.SearchField.TextField.Enabled = False
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Even if i disabled that in the DesignerView it does not work
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Its from @Erel 's B4X Table example.
Here is the belonging part:

Create Table:
Sub CreateTable (Files As List)
    B4XTable1.AllowSmallRowHeightModifications = False
    B4XTable1.RowHeight = 120dip
    Sleep(0)
    B4XTable1.SearchField.TextField.Enabled = False
    For i = 0 To NumberOfColumns - 1
        B4XTable1.AddColumn(i, B4XTable1.COLUMN_TYPE_TEXT)
    Next
    'Force the creation of the cells.
    B4XTable1.MaximumRowsPerPage = 4
    B4XTable1.BuildLayoutsCache(B4XTable1.MaximumRowsPerPage)
    For Each col As B4XTableColumn In B4XTable1.Columns
        col.Sortable = True 'False
        col.Width = 100%x / NumberOfColumns
        For i = 0 To col.CellsLayouts.Size - 1
            Dim pnl As B4XView = col.CellsLayouts.Get(i)
            pnl.GetView(0).Visible = False 'hide the label
            If i > 0 Then 'i = 0 is the header
                Dim iv As ImageView
                iv.Initialize("")
                pnl.AddView(iv, 2dip, 2dip, col.Width - 4dip, B4XTable1.RowHeight - 4dip)
            End If
        Next
    Next
    LoadData(Files)
    B4XTable1.mBase.Visible = True
End Sub



And here the depending LoadData:

LoadData:
Private Sub LoadData (Files As List)
    Dim Data As List
    Data.Initialize
    Dim row(NumberOfColumns) As Object
    Dim index As Int = -1
    For Each f As String In Files
        If f.EndsWith(".jpg") Or f.EndsWith(".png") Or f.EndsWith(".jpeg") Then 'Or f.EndsWith(".mp4") Then
            index = (index + 1) Mod NumberOfColumns
            row(index) = f
            If index = NumberOfColumns - 1 Then
                Data.Add(row)
                Dim row(NumberOfColumns) As Object
            End If
        End If
    Next
    If index < NumberOfColumns - 1 Then
        'last incomplete row
        For i = index + 1 To NumberOfColumns - 1
            row(i) = ""
        Next
        Data.Add(row)
    End If
    B4XTable1.SetData(Data)
End Sub
 
Last edited:
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
For what reason ever, NOW the search filed is not shown anymore.
But the |< < {page number} > >| is already shown
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…