Comments (4)
I'm not sure I understand. What is the connection between the didTapColumn
and formatting numbers? You should be able to format the numbers as you please and then insert that into the Data object as a string.
For example
numberFormatter.style = .currency
numberFormatter.locale = "en_GB"
let number = NSDecimalNumber(decimal: 1234344.44)
numberFormatter.string(from: number)
from swiftdatatables.
An apology if I did not explain myself well, I have already formatted the data, the detail is that if I press the header of any of the columns, the sort that gives me is incorrect because the value of the data is not double, rather its a string ( or so I think that is the reason), since it does not give me a completely correct ascending arrangement neither descending one .
I attach an image.
That is why I tried to catch the click on the header (assuming it was the didtapColumn) and this be able to do the sort by myself.
I hope I explained myself well.
Thanks in advance and greetings.
from swiftdatatables.
Okay, that's a problem. Thank you for writing such a detailed and helpful response.
What we need is a custom sort allowing you to define the sort order for specific columns.
I will want to work on this as soon as possible. Can you tell me how you would want to define the sorting behavior yourself?
from swiftdatatables.
I had the idea of managing a kind of absolute value by converting the currency value to double, in order to make a normal ascending arrangement.
That was why my question, if it was possible to intercept the click in the header. to sort from the arrangement that fills the table.
from swiftdatatables.
Related Issues (20)
- Change cell size and combine them with other elements? HOT 8
- Delegate method for row color: changes Columns instead of Rows! HOT 6
- -[UIView setImage:]: unrecognized selector HOT 1
- Support the dark mode? HOT 1
- Column header text cut off on scroll HOT 7
- Can we add non-text data such as buttons, images and others into the rows of DataTable? HOT 4
- SwiftDataTable Announcement! HOT 2
- Pagination support? HOT 2
- Build issues HOT 7
- Automatic width calculation issue HOT 3
- dataTable.reloadRowsOnly() doesn't do anything and dataTable.reload() crashes HOT 1
- data : Server Side loading HOT 2
- Patron support and (Inline) Editing HOT 1
- Good Work How to Save all tableView data into pdf file with all bounds
- Change theme HOT 1
- How to do Swipe to delete the data-table section?
- Create SwiftDataTables inside TableViewCell
- How to align a column to the right hand side.
- Need Objective ะก example HOT 1
- How user will initially know the screen has left right scrolling ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftdatatables.