tableview

Changing background color (or just color) of row (javafx)

我们两清 提交于 2019-12-25 13:14:43
问题 I've a TableView . I want to change background color of rows according to some condition. For instance, if balance ( getBalance() ) is less than zero - set background color of that row to red. Here is my setCellValueFactory : tc_proj_number.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getId().toString())); tc_proj_date.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getValueDate().toInstant().atZone(ZoneId.systemDefault())

Swift Firebase Sort By Distance

荒凉一梦 提交于 2019-12-25 11:14:23
问题 I am trying to sort my array by distance. I already have everything hooked up to grab the distance's but unsure how to sort from closest to furthest from the users location. I've used the below code for MKMapItem's yet unsure how to apply to my current array. func sortMapItems() { self.mapItems = self.mapItems.sorted(by: { (b, a) -> Bool in return self.userLocation.location!.distance(from: a.placemark.location!) > self.userLocation.location!.distance(from: b.placemark.location!) }) } Firebase

Self growing label in tableview cell

社会主义新天地 提交于 2019-12-25 11:04:17
问题 I am working with Tableview in Objective C . I have 4 labels in a TableView cell. I want to expand the Comment Body label and Answer Body label according to the content size. How it is possible using AutoLayout. Please help me How to set dynamic height of label as per content? The ScreenShot of the tableview is given below. 回答1: Your constraint should be like, Comment -> top, leading(left side), fixed width, fixed height Answer -> top, leading, fixed width, fixed height Comment Body -> top,

UIView not showing in both header views

廉价感情. 提交于 2019-12-25 10:17:37
问题 I am developing an iPad application. For some reasons, I need to show a two tableviews in the same view controller. I have created a UIView in a xib and connected a outlet to that view controller . I need to show that view in those two tableviews as a tableHeaderView . When I try to assign that view to both header views , it is showing only in the second tableview .I hope there is a single instance for that view. So it is showing on only in the view, which I assigned last. How could I

UIView not showing in both header views

落爺英雄遲暮 提交于 2019-12-25 10:17:02
问题 I am developing an iPad application. For some reasons, I need to show a two tableviews in the same view controller. I have created a UIView in a xib and connected a outlet to that view controller . I need to show that view in those two tableviews as a tableHeaderView . When I try to assign that view to both header views , it is showing only in the second tableview .I hope there is a single instance for that view. So it is showing on only in the view, which I assigned last. How could I

How to use UISearchBarController with array subsection

爷,独闯天下 提交于 2019-12-25 09:50:36
问题 I am using the following array structure to create a tableView with sections struct words { var sectionName : String! var coptic : [String]! var english : [String]! } var array = [words]() var filtered = [words]() array = [words(sectionName: "", coptic: [""], English: [""])] I want to utilize a searchcontroller using similar code to this func updateSearchResults(for searchController: UISearchController) { // If we haven't typed anything into the search bar then do not filter the results if

JavaFX populate tableview with a OneToMany relationship

被刻印的时光 ゝ 提交于 2019-12-25 09:09:51
问题 to populate a table is easy when you populate it with data from one class, but what is when I want to populate it with data from a OneToMany relationship? for example: Class Person: Id, firstname, lastname, cars(cars have a onetomany relationship with Class Cars, so one person can have one or more cars) Now, if a person got two cars, how can I add this to a table? It should look something like this: ID | firstname | lastname | vehicleBrand(from cars) ==========================================

JavaFX populate tableview with a OneToMany relationship

烂漫一生 提交于 2019-12-25 09:07:14
问题 to populate a table is easy when you populate it with data from one class, but what is when I want to populate it with data from a OneToMany relationship? for example: Class Person: Id, firstname, lastname, cars(cars have a onetomany relationship with Class Cars, so one person can have one or more cars) Now, if a person got two cars, how can I add this to a table? It should look something like this: ID | firstname | lastname | vehicleBrand(from cars) ==========================================

JavaFX Tableview make specific cells colored

只愿长相守 提交于 2019-12-25 09:01:07
问题 TableColumn tc = new TableColumn(); tc.getStyleClass.add(".style in css file") i set up the tablecolumn with css file. and i want to make each cell has different backgrounds. is there any way to do it? tableColumn row 1 bakcground color = green, row2 = red, row3 = blue....etc 回答1: You have to use setRowFactory for your TableView and change row style. A little example there: tableView.setRowFactory(new Callback<TableView<Data_type>, TableRow<Data_type>>(){ //There can define some colors. int

TableView Enhancements

雨燕双飞 提交于 2019-12-25 08:57:23
问题 The TableView still leaves a lot to be desired. Does anyone have a more complex example of a TableView that you would like to share? Here's what I'm missing: Insert and Delete row: Possible solutions: press TAB on the last cell and new row gets inserted automatically right mouse button -> context menu -> insert line (or delete line) a table footer with table navigation and insert/delete buttons (like MS Access) keyboard shortcut ... Insert and Delete should be either at the current row