B4J Question Tableview Resize Column Event

ziomorgan

Active Member
Licensed User
Longtime User
I want to create text boxes above the header of the grid to be used as a filter boxes and match the width of the columns even when they are resized

Cattura.PNG
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
In the Tableview there are many columns and I must necessarily give the possibility to resize them to the user. It is not possible to create an event ColumnResize_Event for the ResizeFeaturesBase class?
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
alternatively I could create a line of text boxes within the TableView, but if I make a double click on the header of Tableview its text box disappears. Is there a way to solve this problem?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
A resize event will not be enough as you will need to move all the other fields as well. Currently there is no resize event.

alternatively I could create a line of text boxes within the TableView, but if I make a double click on the header of Tableview its text box disappears. Is there a way to solve this problem?
Please create a small example and upload it.
 
Upvote 0

ziomorgan

Active Member
Licensed User
Longtime User
Please see the attached example. You can try to do doubleclick in the middle of two header columns to check that the relative object disappers
 

Attachments

  • TableViewResize.zip
    1.5 KB · Views: 347
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why are you using FXML layouts?

You can use this code to disable double click on the vertical line:
B4X:
  Dim r As Reflector
   r.Target = TableView1
   r.AddEventFilter("TableView1MouseClicked", "javafx.scene.input.MouseEvent.ANY")



Sub TableView1MouseClicked_Filter(e As Event)
   Dim jo As JavaObject = e
   Dim v As Node = jo.RunMethod("getTarget", Null)
   If GetType(v) = "javafx.scene.shape.Rectangle" Then
     Dim m As MouseEvent = e
     If m.ClickCount >= 2 Then
       m.Consume
     End If
   End If
End Sub
 
Upvote 0
Top