Hi all, I really like your library, thanks for all the work.
I'm struggling to add a button to my paginated table view, in plain javafx i would usually do something like that:
Callback<TableColumn<Person,` String>, TableCell<Person, String>> cellFactory = new Callback<TableColumn<Person, String>, TableCell<Person, String>>() {
@Override
public TableCell call(final TableColumn<Person, String> param) {
final TableCell<Person, String> cell = new TableCell<Person, String>() {
final Button btn = new Button("Just Do It");
@Override
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (empty) {
setGraphic(null);
setText(null);
} else {
btn.setOnAction(event -> {
Person person = getTableView().getItems().get(getIndex());
System.out.println(person.getFirstName()
+ " " + person.getLastName());
});
setGraphic(btn);
setText(null);
}
}
};
return cell;
}
};
I adapted this code to a MFXPaginatedTableView but rowcell and column lack getTableView and getIndex method. I can pass the tableview from outside but i can't think of a way to determine the index of the row in order to get my cell object. I didn't find a way in the documentation (or probably simply miss it) to solve my issue. There's maybe a simpler way to achieve what i'm trying to do?
Hi all, I really like your library, thanks for all the work. I'm struggling to add a button to my paginated table view, in plain javafx i would usually do something like that:
Callback<TableColumn<Person,` String>, TableCell<Person, String>> cellFactory = new Callback<TableColumn<Person, String>, TableCell<Person, String>>() { @Override public TableCell call(final TableColumn<Person, String> param) { final TableCell<Person, String> cell = new TableCell<Person, String>() {
I adapted this code to a MFXPaginatedTableView but rowcell and column lack getTableView and getIndex method. I can pass the tableview from outside but i can't think of a way to determine the index of the row in order to get my cell object. I didn't find a way in the documentation (or probably simply miss it) to solve my issue. There's maybe a simpler way to achieve what i'm trying to do?