Created
October 9, 2013 18:27
-
-
Save incepttechnologies/6905850 to your computer and use it in GitHub Desktop.
method showing setup of TableView for Sorting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initializeTable() { | |
personViewIdCol.setCellValueFactory(new PropertyValueFactory<Person, String>("Id")); | |
id.setGraphic(upImg); | |
personViewIdCol.setGraphic(id); | |
personViewIdCol.setSortable(false); | |
personViewNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("Name")); | |
personViewNameCol.sortTypeProperty().addListener(new ChangeListener<SortType>() { | |
@Override | |
public void changed(ObservableValue<? extends SortType> paramObservableValue, SortType paramT1, SortType paramT2) { | |
System.out.println("NAME Clicked -- sortType = " + paramT1 + ", SortType=" + paramT2); | |
id.setGraphic(null); | |
} | |
}); | |
personViewAgeCol.setCellValueFactory(new PropertyValueFactory<Person, Integer>("Age")); | |
personViewAgeCol.setText("AGE"); | |
personViewAgeCol.setSortable(false); | |
personView.getItems().setAll(persons.subList(0, itemsPerPage)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment