tableview

JavaFx 2 - TableView , return selected item

依然范特西╮ 提交于 2019-12-12 17:02:57
问题 I would like to get the selected item as String from a TableView, but it returns the whole path. In the picture above, when I click to select the cell, I would like to get Indicator selected is: = Shannon Entropy; while I get Indicator selected is: taindicators.indicatorsmaingui.IndicatorsGuiController$Indicators@2dafcbf Here is my code tableviewIndicators.setOnMousePressed(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { if (event.isPrimaryButtonDown() &&

How to access to a static cell

烈酒焚心 提交于 2019-12-12 11:23:23
问题 I created a TableView directly in the storyboard; this tableView contains 8 static cells (style basic) in 4 section; now, how could I edit via code these cells? for example for to change textLabel, backgroundColor, separator ecc I tried to set an identifier to each cel but didn't work... 回答1: For static cells created in the storyboard, you can simply set the IBOutlet for the elements you want to edit by ctrl-dragging from the storyboard to the corresponding view controller, to end up with

How to pass data to a UIViewController from a UITableViewRowAction in Swift?

走远了吗. 提交于 2019-12-12 10:24:27
问题 I'm new to iOS programming, and I've been searching for how to do this, but can't seem to find what I'm looking for. I thought this would be a fairly easy task, and I'm sure it is if someone can enlighten me. When you swipe left on a table view I have some custom actions that can be performed. One of those actions is a simple "Edit" of the item selected. All I want to do is display another view controller but pass some data to that view controller like how it's normally done in

Creating Section Titles in a Table View Controller with date attribute in Core Data

若如初见. 提交于 2019-12-12 10:17:18
问题 I have a substantially working app at the moment and I'm currently going through a learning process of enhancing this. I have a TableViewController which when prompted, asks a user to input some information and when the user clicks save, that information is displayed appropriately in the table view. I would like to ask the user to add one more bit of information and that will make up the section. This will be the date. Think of Instragram; before each picture, you have a date, etc. I want to

JavaFX Span Tableview Merge Cells by MapEntries

主宰稳场 提交于 2019-12-12 09:55:46
问题 Hello i have the following Map: Map<String,ArrayList> I would like to have a TableView like this |--------------|-----------| |ArrayList e1 | String e | |--------------| | |ArrayList e2 | | |--------------| | |ArrayList e3 | | |--------------|-----------| |ArrayList x1 | String x | |--------------| | |ArrayList x2 | | |--------------|-----------| I already tried it with several CellValueFactory Callbacks, but i don't have any clue how to read out my values and, span or merge these cells. Best

Pass data from struct array to new tableview controller

爷,独闯天下 提交于 2019-12-12 05:13:19
问题 I am trying to pass data from my Cheats struct into a new tableviewcontroller to populate the new table with the relevant info. I have done research but am new to swift. I do have experience in php but transferring my knowledge is proving quite difficult... In my prepare for segue class i receive a few errors: Definition conflicts with previous value: var DataPass = CheatsArray[indexPath.row] Cannot assign value type 'String' to '[String]': DestViewController.CheatsArray = DataPass.name Here

set BackgroundImage to UITableView Section (viewForHeaderInSection)

≯℡__Kan透↙ 提交于 2019-12-12 05:06:50
问题 I have tried it with - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 100)]; headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth; headerView.opaque = NO; headerView.backgroundColor= [UIColor blackColor]; return [headerView autorelease]; } But how can i set a BackgroundImage to the sections? Thanks much 回答1: You can set the background colour to a

send data to DetailView from FavoriteTableView?

自作多情 提交于 2019-12-12 04:39:26
问题 i have tableview,detailview ,and favoriteview in my app.when user touch cell in tableview will go to detailview thats contain photo,label,textfield and button for add to favorite.user can touch favorite button to add specific cell to favoritetableview. i can succefullly add cell to favoritetableview but when i touch cell in favoritetableview and go to detail view , nothing load in detailtableview ( photo and textfield and etc) just only can send name to detailview how can i send photo and

swift 3 Calculate distance to current location and sort result from closet to furthest

末鹿安然 提交于 2019-12-12 04:34:51
问题 I'm trying to to calculate the distance from an event to my current location, sort the results and populate that in a tableview. I keep getting error for optional unwrapped value distance is nil. private func observeEvents() { refHandle = ref.observe(.childAdded, with: { (snapshot) -> Void in let eventDetails = snapshot.value as! Dictionary<String, AnyObject> let eventID = snapshot.key let location = eventDetails["location"] as! String! //calculating distance self.forwardGeocoding(address:

TextField inside TableView gone after scroll JavaFX

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 04:33:59
问题 I have a table view and inside it, there is one column filled with TextField. There is no problem when I have few data and my table do not have scroll bar, all TextFields appears. The problem is, when I scroll down my table and then goes up again, some TextFields are missing. Here is my code for the column filled with TextField: purchaseQtyCol.setCellFactory( new Callback<TableColumn< TransactionModel, TextField>, TableCell< TransactionModel, TextField>>() { @Override public TableCell<