tableview

Suming a specific TableView column/row in JavaFX

ⅰ亾dé卋堺 提交于 2020-01-25 06:21:11
问题 I have done this in java where I sum the values of the price column/row. But I am wondering how to do this in JavaFX. I want to sum everything in column 1 and display it in a inputField , I used this to do it in java but how do you do this in JavaFX? tableview.getValueAt(i, 1).toString(); Here is what I'm trying to do: int sum = 0; for (int i = 0; i < tableview.getItems().size(); i++) { sum = sum + Integer.parseInt(tableview.getValueAt(i, 1).toString()); } sumTextField.setText(String.valueOf

How to hide TableView column header in JavaFX 8?

試著忘記壹切 提交于 2020-01-24 04:44:08
问题 I need to have an observable list of a type that will be displayed in a TableView with one single column, that when selected will display the rest of its information on the right. The TableView is wrapped in a TitledPane, which is wrapped in an Accordion. See image below: As you can see in this scenario I don't want to show the Column Header. I tried following the instruction here, which leads to here: Pane header = (Pane) list.lookup("TableHeaderRow"); header.setMaxHeight(0); header

fatal error: Index out of range when refreshing table view

試著忘記壹切 提交于 2020-01-23 01:41:09
问题 I've this weird app crash when pulling to refresh occurs. My code goes as it follows: var posts: [Posts] = [] override func viewDidLoad() { super.viewDidLoad() // refreshControl -> pull to refresh handler let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: #selector(Main_TVC.getData), for: UIControlEvents.valueChanged) self.refreshControl = refreshControl getData() } override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func

Reloading UITableView shows error?

人走茶凉 提交于 2020-01-20 07:52:19
问题 I am in a strange situation . when i try to reload the tableview using reloadData() it shows the following error . . . fatal error: unexpectedly found nil while unwrapping an Optional value Here is the web service method that retrieves output func didRecieveOutput(results:NSArray) { if results.count != 0 { userOrders = results as! NSMutableArray dispatch_async(dispatch_get_main_queue(), { () -> Void in self.orderList.reloadData() }) } } Edit : I had checked my connection as well as delegate &

How to create a tableview(Qt5.12)with model as listModel that can host variable number of columns?

故事扮演 提交于 2020-01-17 16:29:20
问题 I am creating a Table with multiple rows and multiple columns.How can I use Qml TableView to create a table with multiple rows and columns? I tried with an older implementation of tableview but now want to create the same using the new tableview provided in Qt 5.12.Below is the example code of my older implementation QtObject{ id:internals property int rows:0 property int col:0 property int colwidth:0 property var columnName:[] } ListModel{ id: libModel } TableView{ id:tblview height:parent

UIImage in TableView eating memory

匆匆过客 提交于 2020-01-17 12:12:39
问题 i have tableView with 12 images. 1 for each row. The image size is 536 x x536 px (and 804 x 804 for @3x) all in JPG format with about 250kb file size. When i use Simulator, the memory reach 40MB for that tableView only. Yes, i've used dequeueReusableCellWithIdentifier . here is the screenshot : is it normal? or how i can improve it? because i use UIImage(named:....) so it's cached. I haven't try to use real device, still waiting for my credit card.. :) here my code for cellForRowAtIndexPath :

UIImage in TableView eating memory

☆樱花仙子☆ 提交于 2020-01-17 12:12:25
问题 i have tableView with 12 images. 1 for each row. The image size is 536 x x536 px (and 804 x 804 for @3x) all in JPG format with about 250kb file size. When i use Simulator, the memory reach 40MB for that tableView only. Yes, i've used dequeueReusableCellWithIdentifier . here is the screenshot : is it normal? or how i can improve it? because i use UIImage(named:....) so it's cached. I haven't try to use real device, still waiting for my credit card.. :) here my code for cellForRowAtIndexPath :

Search Bar in Table View Swift

最后都变了- 提交于 2020-01-17 05:23:27
问题 im doing a simple project in Xcode 6 and i want to add search bar in tableviewcontroller but something is not working for me. Im doing it by this tutorial http://www.raywenderlich.com/76519/add-table-view-search-swift override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if tableView == self.searchDisplayController!.searchResultsTableView { return self.filteredProgramy.count } else { return self.programy.count } } here im getting error "fatal error:

How to resolve Titanium TableView display problem?

烈酒焚心 提交于 2020-01-17 05:19:18
问题 I have tableview in titanium.I have displayed 12 labels in 3 different rows.When i am using it first time it is showing all of the 3 rows properly with content. Whenever i am coming back from the tableview to other view and again i am going to access the same tableview, i can not see tableview content, i can only see blank rows. can anybody help me out , what exactly the problem is and why am i not able to see content again(2nd time) when tableview loads. I have added whole code snippet below

How to call (show) another View Controller when clicked on the cell of Table View in Swift

时光怂恿深爱的人放手 提交于 2020-01-17 04:48:04
问题 I'm new in Swift. I want to learn that, how to call another View Controller when the user clicks on cell of Table View. Thanks in advance. 回答1: write following code : func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { self.performSegueWithIdentifier("showItemDetail", sender: tableView)} override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) { if segue.identifier == "showItemDetail" { let indexPath:NSIndexPath = self.tableView