-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to not show sections in table #3
Comments
Hi, Igadams
Just set
Definitely there are. Looking into the file - (CGFloat)tableView:(EWMultiColumnTableView *)tableView heightForCellAtIndexPath:(NSIndexPath *)indexPath
column:(NSInteger)column;
- (CGFloat)tableView:(EWMultiColumnTableView *)tableView widthForColumn:(NSInteger)column; the 2 methods do exactly what you want. Maybe you are not familiar with the original UITableView. This multi-column table view is designed working in the same way of the original UITableView. You implement some required delegate methods, then you got the basic layout. If you want it more customizable, just implement more. |
Hi Xenofex, For the sections issue... looks like I need to update this function to be something like this: - (NSInteger)tableView:(EWMultiColumnTableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(tableView.sectionHeaderEnabled == NO)
return [data count];
else
return [[data objectAtIndex:section] count];
} I also didn't realize if I didn't implement numberOfSectionsInTableView() in MultiColumnTableViewViewController.m the correct number of rows are returned correctly. I had another question for you about the grid. Is there away to have a different number of columns on each row in the grid? The current application I am working on has column spans that will span the entire grid. |
For this question: - (NSInteger)tableView:(EWMultiColumnTableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView.sectionHeaderEnabled == NO)
return [data count];
else
return [[data objectAtIndex:section] count];
} So you want a grid with out sections. Then you just have one section there and set - (NSInteger)numberOfSectionsInTableView:(EWMultiColumnTableView *)tableView; the number of sections will be 1, similar as the UITableView For the column spaning, currently it doesn't support. I'll think about a quick way to implement this. For now if you set only the width of some column to be wide enough to span across columns, the vertical table line will be above of it. |
Is there is any possibility to span columns on top so its like a common col span for multiple rows below. Take an example that the left item rows are fixed and right side are as follows Months Column span cell for below rows Jan - Dec then next 2 columns header is spanned as 1 on first row. When i scroll up the first two should remain on top and when i scroll left the entire spanned header row 1 and 2nd sub columns are scrolled left. |
Hi Xenofex,
I have been playing around with the grid and have been trying to find an easy way to not use sections.
What I have come up with, which I think needs some work is something like this:
In your example, I have modified viewDidLoad in MultiColumnTableViewController.m to look like this:
and modified this method to just return the number of rows…
Is there an easier and more readable way to not use sections and just have pure rows in the grid? I couldn't really see any other way with out extending the API a bit...
Also, is there a more dynamic way to calculate the width/height of the columns rather than hard coding them? Sorry I am new to iOS programming.
Thanks!
The text was updated successfully, but these errors were encountered: