Closed deni5n closed 2 years ago
MFXTableColumn<User> idColumn = new MFXTableColumn<>("Id", true, Comparator.comparing(User::getId));
idColumn.setRowCellFactory(user -> new MFXTableRowCell<>(User::getId) {{
setOnMouseClicked(mouseEvent -> {
ObservableMap<Integer, User> map = FXCollections.observableHashMap();
int i = users.indexOf(user);
map.put(i, user);
table.getSelectionModel().setSelection(map);
setContextMenu(menu(user));
});
}});
but context menu is not showing. perhaps the update is not synchronous and the context menu is overwritten?
There is no context menu by default plus there's a much simpler way to allow selection with the right mouse button
For both you need a custom row you can extend MFXTableRow as it already offers everything you need Check both the documentation and the src code
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closed for inactivity.
I will need to render the selected row in "MFXTableView" when the user presses the right mouse button to display the context menu (by default, the row is not selected when the user presses the right mouse button). I see the method:
but that i can send him a parameter? can you provide an example?