tableview

Connect TableView columns to the HashMap values

只谈情不闲聊 提交于 2019-12-25 08:52:27
问题 I'm writing a simple crud-redactor, and there is a problem I stuck on: I have a class: public class Note { List<String> columnNames; HashMap<String, SimpleStringProperty> items; } which I need to somehow connect with a TableView via setCellValueFactory . For example I have 3 values in HashMap with keys "id" , "name" and "age" . So I want to have 3 columns in TableView which are connected with this HashMap and will represent its values after wrapping an array of Notes into ObservableList and

UITableViewController with different Cell sizes and Cell content in Storyboard

橙三吉。 提交于 2019-12-25 08:20:10
问题 I want to make a UITableViewController with different Cell sizes and different content of the cells. For example: Is there a way to use AutoLayout within the Storyboard to define the different sizes of the TableViewCells ? What would be the best way to define the content (a UIView with content on it) of the TableViewCells ? 回答1: To change the cells of the UITableView, you have 2 options: Option A (best) is to use Autosizing TableView Cells with Autolayout Constraints. To use option A, you

TableView Images does not load until scrolling

大憨熊 提交于 2019-12-25 07:49:12
问题 I'm using Firebase to load my images into my cell's ImageView but! there is a problem. I'm using caching mechanism for preventing images to redownload when reusable cells loads but the images do not load until i've scroll my TableView . Here is the code; public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell cell.imgv.image = nil if let urlString = self

Why is indexPath for section 1 of a tableview starting with a value of [1,0]

ε祈祈猫儿з 提交于 2019-12-25 07:49:00
问题 I have a tableView and it's split into 2 sections. func numberOfSections(in tableView: UITableView) -> Int { return 2 } Each section has it's own FetchResultController (FRC). This is my CellForRoatAt function func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "personCell", for: indexPath) as! PersonTableViewCell switch(indexPath.section) { case 0: print("this is section 0") let person =

Is there any SimpleLOngProperty in javafx if not then what to do?

丶灬走出姿态 提交于 2019-12-25 07:29:21
问题 I am working with javafx2.2 . I am creating a table using tableview , my data is of different type. int,string,float,double have SimpleIntegerProperty , SimpleFloatProperty , SimpleDoubleProperty , SimpleStringproperty But what to do for long , char , TimeStamp and float sequence. I need to use these because of sorting performance see this Thank You 回答1: You can just create ObjectProperty like that ObjectProperty<Float> floatObjectProperty = new SimpleObjectProperty<Float>(); ObjectProperty

ControlsFX Notification Graphic corrupted

谁说胖子不能爱 提交于 2019-12-25 06:11:58
问题 I am using ControlsFX Notification to display a group of messages. Text is not perfect way for me, so I present data in TableView. import org.controlsfx.control.Notifications; ...... TableView<NotificationModel> notificationTable = new TableView(); ...... Notifications notification = Notifications.create() .title("Transaction Notifications") .text(null) .graphic(notificationTable) .position(Pos.BOTTOM_RIGHT) .hideAfter(Duration.minutes(1)); notification.show(); In normal case, notification

ControlsFX Notification Graphic corrupted

大兔子大兔子 提交于 2019-12-25 06:11:24
问题 I am using ControlsFX Notification to display a group of messages. Text is not perfect way for me, so I present data in TableView. import org.controlsfx.control.Notifications; ...... TableView<NotificationModel> notificationTable = new TableView(); ...... Notifications notification = Notifications.create() .title("Transaction Notifications") .text(null) .graphic(notificationTable) .position(Pos.BOTTOM_RIGHT) .hideAfter(Duration.minutes(1)); notification.show(); In normal case, notification

How to select/highlight next row in TableView (JAVAFX)

青春壹個敷衍的年華 提交于 2019-12-25 03:15:14
问题 I'm making a media player in JavaFX. I'm displaying the songs in a TableView object. And whenever I press the Skip button, I would like it to highlight the next row, so that the user can see which song from the playlist, that he is listening to. This is the code for the TableView. I would like it to get the selected element, and then select/highlight the next element for me, whenever a certain method gets invoked. @FXML private TableView<Song> defaultTableView; // 1) Song Title @FXML private

How add Size and Position to ImageView in UITableView Cell?

拜拜、爱过 提交于 2019-12-25 02:44:34
问题 I added a image to my UITableView Cell: cell.imageView!.image = UIImage(named: "Default.png") Everything works, the image is displayed. Now I want to give a custom size and position for the image, so I try it with this code: cell.imageView!.frame = CGRect(x: 29, y: 17, width: 14, height: 13) But for any reason it doesn't work. Any advices? 回答1: If your position will not change You can create frame in your TableViewCell class TableViewCell: UITableViewCell { @IBOutlet weak var imageView:

Sorting results from Parse is not working as expected with query.limit

ε祈祈猫儿з 提交于 2019-12-25 02:25:27
问题 I set a limit for my query to be 10 for example and then I want to get the last 10 results in the data set AND sorted with ascending time! Okay I know I can add: [messages addDescendingOrder:@"createdAt"]; //OR [messages addAscendingOrder:@"createdAt"]; But what this is doing is that it is getting the first 10 records or the last 10 records... It is not sorting the results themselves!! The ascending order is basically setting where the results are going to start... From bottom or from top.