Closed hamzabinamin closed 5 years ago
I have some time now to develop features for this package.
Would the user only be able to scroll the far left columns? Or would they be able to freeze columns in the middle - which would be a harder implementation and I'm not sure what the results of that might look like
They should be able to freeze or lock a certain column and the scrolling should work only for the columns after that or before it.
Are we talking about horizontal or vertical scrolling? Can you give me a more detailed example?
This is what I originally imagined which locks a column from horizontally scrolling so they are always visible: https://demos.telerik.com/kendo-ui/grid/frozen-columns
horizontal, the one in the link should be good enough.
Like this please!!!
@pavankataria Were you able to figure it out?
Btw our first version is live on the app store now. If you want I can link it here.
@hamzabinamin Absolutely, that'll be awesome.
@annpt1 Thank you. That's great. @hamzabinamin
Were you able to figure it out?
No, I haven't started this work yet since I've been incredibly busy due to some issues that took place at work.
I now finally have the time and have been closing issues today and releasing a new update which you guys should download for the fixes!
Quick update, I started this feature several hours ago and have just finished it. I feel the use of the new api is straight forward! cc @hamzabinamin @annpt1
Here's how you define which columns you want frozen, by using the all new DataTableFixedColumnType
class, and using any of the initialisers like so
// Example 1 - freeze from the left
DataTableFixedColumnType(leftColumns: 1) // this will freeze the n number of columns from the left of the table. In this case column number 1 - the first columns. This is a one-index based system
// Example 2 .- freeze from the right
DataTableFixedColumnType(rightColumns: 1) // this will freeze n number of columns from the right of the table. In this case the last column.
// Example 3 - multiple columns
DataTableFixedColumnType(leftColumns: 2, rightColumns1) // You can specify multiple columns to be frozen on both sides. In this case the first 2 columns and the last column.
You can implement fixed columns in your data table in two ways:
Simply adopt the SwiftDataTable's delegate method with the following signature:
@objc optional func fixedColumns(for dataTable: SwiftDataTable) -> DataTableFixedColumnType {
// and return the object here
return .init(leftColumn: 2) // freeze the first two columns
}
var configuration = DataTableConfiguration()
configuration.fixedColumns = .init(leftColumns: 2, rightColumns: 1) // freeze both the first two columns, and the last column
This is now available as of version 0.8.0 🎉 🎉 https://github.com/pavankataria/SwiftDataTables/releases/tag/0.8.0
I hope this will serve you all well. Let me know what you think 🎉
🚀 SwiftDataTables (0.8.0) successfully published on 📅 June 19th, 05:26 👍 Share with your friends and colleagues!
@pavankataria Hey thanks for this :D
Is there a way that the user can fix/unfix a column by touching on the screen?
Also a few number of our users reported that they'd like to see the text wrap up to the next line (currently when the text is long, it uses a smaller font as compared to other row items). Is this somehow achievable?
Again thank you for the great work.
The link to the app: https://apps.apple.com/us/app/sports-apple/id1447253053?ls=1
Do you have animations on what the interactions for the fixing and unfixing might look like?
Also a few number of our users reported that they'd like to see the text wrap up to the next line (currently when the text is long, it uses a smaller font as compared to other row items). Is this somehow achievable?
Yeah I have to think about this as currently the rows heights are specified rather than calculated with auto layout.
Please create issues for those two other requests so they can be individually tracked.
Is there a way I can lock or disable the scrolling on one of the columns so that when the user scrolls the columns next to it, they can still see the previous column data?