I have an application with items that have a fixed number of attributes, like a record. I display each item within its own section in a UITableView: the item name is the section header and the attributes are rows:
========
Section Header 0: Car A
========
Row 0 - Size: X
Row 1 - Color Y
Row 2 - Number of wheels Z
...
========
Section Header 1: Car B
========
Row 0 - SizeL XX
Row 1 - Color YY
Row 2 - Number of wheels Z
...
I want the user to be able to delete items at the section level, like deleting a record. The best way from UI standpoint I can think to do this is to simulate the row-level delete symbol and behavior by moving all the rows within a section to the right and showing the delete symbol centered vertically within the section on the left:
=======
Section Header 1
=======
Row 0
(-) Row 1
Row 2
Is there an accepted way to approach this? Apple is doing this in the Contacts app in iOS7 for the address fields like this:
What is the general technique for this? Any help or direction greatly appreciated!
For others that have looked at this problem, the way to go is to implement rows that looks like sections. In the example of a record that has fields, a row should correspond to a full records, rather than a section for each record with rows within the section for the attributes.
I hope this helps. The Apple example for contacts app is informative here.
Related
We've encouterred a problem where we need to use rowSpan and autoHeight (or any kind of dynamic height) for a cell in tandem.
According to the docs, autoHeigth is not supported when using rowSpan: https://www.ag-grid.com/archive/27.1.0/react-data-grid/row-spanning/#constraints-with-row-spanning
Our scenario:
We have a grid, where the first column is a "grouping" column, and the next columns are for "children" properties. E.g.: United States has 4 athletes, so the first column would span 4 rows, and the others 1. The issue is, we need to show more information in the first column, and it works ok if there are 2 or more "children" - the information fits in the cell, but when there is only 1 "child", the 1st column only spans 1 row and the information's does not fit. Some kind of mechanism is needed to make the row higher when, let's say rowSpan is less than 2.
Here's the a simple plunker to represent the scenario: https://plnkr.co/edit/lSO9tOKPfsBmrzPC
As seen in the screenshot, the cell contents do not fit, on row 5 (2 based on the 1 column rowSpan)
Since autoHeight is not supported when using rowSpan, has anyone encountered a similar scenario and has a suggestion for a workaround for dynamic height?
** I'm using SSRS2008 R2
I have a report that the users would like to see in a printable pdf.
Problem is there are several columns, potentially too many to fit on a printed 8.5x11 paper.
One of the concepts they suggested was a stacked header/data display, like breaking the columns into 2 rows, so 2 rows of data (for John and Bill) would look like this:
NAME START_DATE STATE COMPANY
ACCOUNT BALANCE END_DATE
-------------------------------------------------------
John 1/20/2016 NY GE
10076 $100.00 2/20/2016
-------------------------------------------------------
Bill 5/13/2016 MA Netflix
00013 $150.00 12/31/2016
-------------------------------------------------------
This leads me to 2 questions:
Is there a way to do this with a tablix?
AND/OR in addition, is there a way to set a default property on the report so when the report is exported to pdf and to print, that it defaults to fit all columns on one page (therefor shrinking the font size to fit on page?)
For anyone that cares - Apparently this can easily be achieved by dragging a Tablix onto the work area, right clicking the header row, adding a new row underneath (basically becomes header row 2), then do the same thing to the details row - however make sure to insert row - Inside group. That allows you to have stacked header and data rows and you can copy / paste headers and row values in whichever row you'd prefer.
it will work if you make all the columns on the same height not unequal. If all the columns has same height, then while exporting to pdf/excel and print it will come in the same page.
I have a form with two grids. I have one table with rows where each row has a status of Yes or No. I'd like to display all the yes's in the top and the no's in the bottom grid.
A similar scenario would be if I wanted to show SalesTable header records. The top grid would be only those with a status of Delivered, and the bottom grid those with a status of Invoiced.
How can I accomplish this?
I've gotten close by adding another datasource of the same table type. I add a QueryBuildRange to filter the records but I get two issues:
When I click on a row in the top/bottom, it moves both row lines at the same time (the highlighting thing
It wants to show an equal number of top rows as bottom rows for some reason?? If I have 3 delivered sales orders, and 5 invoiced sales orders, it will show 3 in the top and 3 in the bottom.
Seams like the Grid-controls are being controlled by the same DataSource.
Check the properties of the Grid-control: make sure they are not set to the same DataSource!
Anyway, it would be helpful to know how the Form is structured and how the QueryBuildRange was added.
I created a very simple Form and it worked correctly:
added two Datasets with T-SalesTable each
added two Grid-controls to the Design (or to a TabPage, both worked)
adjusted the DataSource-property of each Grid to point to each DataSource
added fields (the AutoReport group) from the corresponding DataSource to each Grid
this one worked correctly (despite having the same contents. Then I
added a range in the init method of each of the Datasets
and it still worked.
I want to create a page in iphone sdk which looks same as flight search result
problem is that each there are different number of stops some has 2 stops some has 1 etc. and not only leave flight detail but return flight detail can also be asked.
It must sorted on the basis of charges.
I am not getting from where I start
I make 3 custom cells
showing source n destination detail
the flight detail
to make separator between leave n return results
this is demo i have tried with fixed value! [1 row a SimpleTableIdentifier(background color not able to set) 2 and 3 row are 2 different CustemCell, there is separator custom cell too]
but I think i make it complex unnecessary
any tips and help will be apprecited thanks in advance.
Go like this make three customCell one for each of your three category
cell structure to show source and destination detail
cell structure to show flight detail
cell structure to make seperator
Now your UITableView will be a grouped tableView with numberOfSections = number to total flight you have to show
Each section will have three rows (if it has all three information available) else you can reduce the number of rows in any section by delegate method of UITableView named numberOfRowsInSection.
Try not to forget to give all different custom cells other dequeueReusableCellWithIdentifier's for re-usability.
It's been a while since I messed with my TableViewController so I'm a bit rusty...but now I'd like to set it up so that when a section has zero rows to display (array is empty) then it will "lie" to the controller and return 1 for numberOfRowsInSection. Then in the cellForRowAtIndexPath it will place a UILabel over the one row's cell that says something to the effect of "this section is empty."
Problem is when the table is in editing mode and user deletes the last row I get the following error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 1. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted).
It seems to be upset that after the swipe-to-delete a row when it tries to redraw the table it finds that last row is still there. Where/how should I be handling this? Certainly I'm crapping all over Apple's HIG to some extent but it's confusing to my users to have just a header over an empty section...
thanks!
You need to actually insert your "fake" row using -insertRowsAtIndexPaths:withRowAnimation:. From UITableView's point of view, there are no "real" rows or "fake" rows. There are whatever rows the datasource says there are. So you had 1 row, and then you deleted 1 row, and then UITableView asked you "how many rows are there" and you said 1, and UITableView said "1 - 1 = 1. Wait, what? Blam."
If you want to insert a row ("real" or "fake" is all the same), you need to tell UITableView you're inserting it.