Comments (5)
Isn't that just the example data from the wiki [1] with the two numbers transformed from strings into numbers? If this is real data and a real issue you are having, can you not use the load functioned mentioned on that wiki page to transform those two numbers back into strings?
Please reopen if this doesn't work for you.
[1] https://github.com/fiduswriter/Simple-DataTables/wiki/ajax#example
from simple-datatables.
Thanks for the quick response. Yes, that's correct. It is the example to illustrate the issue we are having with our real data. Could you please explain why a number like 9958 is not shown and a number as a string "9958" is shown?
from simple-datatables.
Right. But as I said in my last response, there is a method to transform the data before using it. So there you transform it into a string. Typesafety is a good thing although in this case it's more coincidence.
from simple-datatables.
Ok. I understand. The load function might work, but because of the amount of data and the amount of numbers within the data it would not be our preferred way of doing it. It is also different from datatables.net. Therefore I would like to reopen this issue. I would also like to help or contribute if I would know how.
from simple-datatables.
The data conversion has to happen any way. There is no way you can make it faster by moving this code into Simple-DataTables, no matter how many numbers we are speaking of.
datatables.net is using what was common practice some 10 years ago when everything was relying upon jQuery. I assume that it automatically converts the data to a string. While that may seem convenient sometimes, it will quickly lead to all kind of problems when data is being auto converted like that. Read more about that for example here.
So I don't think we should switch to the behavior of datatables. But what could be done is adding an example to the wiki of how to do the type conversion for such cases. Also note that in some cases you may want to just convert it to a string directly, whereas in other cases you may want to take into account the length of the number so that sorting works out correctly. Otheerwise "900" will be after "1000" just because "9" is larger than "1".
At least that is my initial take. Maybe there could be a way of specifying the type of each field, but there is no way it can involve fewer calculations than just converting all the data in the function as described above.
from simple-datatables.
Related Issues (20)
- [BUG] Cant get Template to work... HOT 1
- [REQUEST] Row Group
- multiSearch not working for me HOT 5
- Title/field headings HOT 5
- Support for colgroup
- [BUG] init() method has no options parameter anymore? HOT 6
- events cannot be fired in the chrome environment HOT 2
- [BUG] A form field element should have an id or name attribute - HTML validity
- [BUG] Can't sort numeric columns
- [BUG] Columns.hide() and show() don't work with integer values
- Responsive Mobile HOT 8
- [BUG]`TypeError: Cannot read properties of undefined (reading 'settings')` at re insert table in version ^9.0.0 HOT 4
- [Feature Request] Ability to hide rows HOT 6
- [BUG] searchQuerySeparator not working via CDN HOT 2
- [BUG] columns property not properly generated HOT 2
- [BUG] Destroying and removing the table element is not working correctly HOT 1
- [BUG] data-order HOT 1
- [BUG] attribute data-sort not working in <th> HOT 2
- Sorting with empty cells doesn't work correctly.[BUG] HOT 2
- Input Listeners not working on subsequent pages [BUG] HOT 2
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 simple-datatables.