tableview

Change the color of a single data cell in a TableView

五迷三道 提交于 2019-12-23 03:21:38
问题 I have a column in a table view and i want: Green font if i write "OK", red font if i write "KO". The problem is that i try to modify this value in the method "setCellFactory" but it doesn't work because the String have all the same color (red or green) that is the color of the last String... For istance if my last value is "KO" all the String in my column will be red. How can i do? Thank you for the help! reader.getSampleController().xmlMatch.setCellFactory(new Callback<TableColumn,

Swiping a row in a tableview, clicking other, selects swiped

大兔子大兔子 提交于 2019-12-23 03:17:19
问题 I have a tableview, and whenever I swipe a row in section A and after that select a row in section B, it thinks I selected the swiped row in section A! I placed a breakpoint to verify and am 100% sure that it thinks it's that cell AND that it calls it when I select the row in section B. By swipe I mean that you place your finger one some part of a cell, then drag it across (left or right, doesn't matter) and then release it. This doesn't call didSelectRowAtIndexPath, since it is not a tap.

Can I use a CheckBoxTableCell in my TableView as a way to let the user select multiple rows?

拟墨画扇 提交于 2019-12-23 02:52:42
问题 In my TableView, I want to have a column that contains a checkbox. This checkbox is a way for the user to select which rows they want to be marked for a certain action, such as deletion. I have tried using a CheckBoxTableCell but all the examples I have seen have binded the checkbox's value to some boolean property of the model. The model on which my TableView is based on is a JPA entity and does not have such a field. I am also reluctant to add such a field because it would not be relevant

filterTableViewController.reloadRows reloading rows only on first call

筅森魡賤 提交于 2019-12-23 02:38:38
问题 I have a table with 3 rows each with check button.What I am doing is when I select all the three buttons I want to click my cancel button which is on view not table on same controller to reload all 3 rows the call goes to custom cell class where uncheck is set to true and rows are reloaded.For the first attempt it works fine I can see correct index to be reloaded.On the second time again when I select all 3 check buttons and click cancel again I can see correct index to be reloaded but the

iOS 5 JSON to tableView error

左心房为你撑大大i 提交于 2019-12-23 02:22:09
问题 I was trying to parse a JSON string from USGS. However I get error "-[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance 0x68a34c0" Basically, I would like to parse the USGS JSON into the tableview. Can anyone help? Here are my codes. ViewController.h @interface EarthquakeViewController : UITableViewController { NSArray *json; NSDictionary *earthquakeReport; } ViewController.m - (void)viewDidLoad { //content = [NSMutableArray arrayWithObjects:@"one", @"two", nil]; [super

JavaFX TableView - New Values in new Cell in same Row

被刻印的时光 ゝ 提交于 2019-12-23 02:19:48
问题 I've got following problem: I styled a TableViews Cells into Rectangles. Now I want to add Objects with an X and Y Coordinate in it ( obj.getAblaufX() and obj.getAblaufY() ). How can I add them correctly in JavaFX TableView? My Current Code: ObservableList<Event> eventList = loadEvents(); TableView<Event> tableView = new TableView<Event>(); tableView.getSelectionModel().setCellSelectionEnabled(true); tableView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); tableView.setItems

iPhone - adjust size of table view according to text

戏子无情 提交于 2019-12-23 01:40:10
问题 Is there a way to adjust the size of a table view AND get the text to wrap in iPhone? I'm using the following code, and it succeeds in adjusting the height of the cell, but the text doesn't wrap, it just ends with "...." - (CGFloat)tableView:(UITableView *) tableView heightForRowAtIndexPath: (NSIndexPath *)indexPath { CGSize cellHeight; City *thisCity = [cities objectAtIndex:indexPath.row]; NSString * myString = thisCity.cityName; cellHeight = [myString sizeWithFont:[UIFont systemFontOfSize

NSInternalInconsistencyException on RootViewController

落花浮王杯 提交于 2019-12-22 09:31:39
问题 I'm trying to create a navigation-stype app, but I want to customize the initial view so that the tableview doesn't occupy the entire frame, but rather is embedded within a sub-view so I can some labels and an image when the app is first launched. I declared UIView and UITableView ivars in RootViewController.h , and added them both as properties with the standard " (nonatomic, retain) IBOutlet " tokens; and in RootViewController.m , I synthesized both, and added code to set them to nil in

Binding JavaFX 2 TableView elements

独自空忆成欢 提交于 2019-12-22 09:08:30
问题 I was working on a small application using a simple binding in JavaFx 2.1 using java 1.7.0_04-b21 on MacOSX. Actually I currently compare the bind mechanisms of Cocoa on Mac OSX to the JavaFx and face several problems: The application uses a model holding an observableArrayList (called messageList) which is set as the items of a TableView. Adding a new Entry to the list works. The entry appears in the TableView. Issue 1: Deleting a selected item does not work. When I remove an item from the

JavaFX - How to change TableView color of selected unfocused row?

匆匆过客 提交于 2019-12-22 06:40:09
问题 No matter what i do - the color of the row keeps unchanged and has a greyish color. The changes only work for when the TableView is in focus. I have tried every other suggestion i found online, for example a solution from another thread: .table-row-cell:selected { -fx-background-color: red; } Nothing seems to work and affect the rows when not in focus. 回答1: Problem You want to change the color of the selection bar for a focused and unfocused state of TableView Solution There is a -fx