parallax / ddt Goto Github PK
View Code? Open in Web Editor NEWDDT (Drag and Drop Tables) is a library that adds drag and drop reordering support to HTML tables.
License: MIT License
DDT (Drag and Drop Tables) is a library that adds drag and drop reordering support to HTML tables.
License: MIT License
We should look at replacing it. It seems to ignore a lot of errors that tsc
reports, and can't generation '.d.ts' files which we will probably need to generate before rc.
Sometimes this is a bad thing, sometimes it isn't.
Sadly, there's not really a good way to detect if you need this besides making it an option.
Looks like we'll be releasing version 0.5 today. Guess semver isn't that great.
Right now you can only reorder rows within a table. What if we were able to support dragging between different tables.
Some concerns with this
I'd say that we shouldn't hold back on releasing version 1 for this idea. It's just something to think about for the future.
I'll just leave this here so we can judge support for this feature.
When table rows are different heights, there are issues with the calculation we use (that we stole from jQuery) to decide if we should swap rows.
If we fix this, then we'll be one step closer to fixing #37 too.
DDT has lots of distinct parts that could probably be separated and then dependency injected.
The following identifiers can be moved into their own module
The current setbacks for this is that as we are using RequireJS as our TypeScript module output, there doesn't seem to be a nice way to concat all our modules into one module in one file. (We only want to export one module). If we don't concat, we run into issues were the user has to define paths for every internal module which isn't nice at all.
ACE editor seems to have gotten around this issue somehow but I'm not sure how.
Issues with this is TypeScript doesn't technically support UMD. We'd have to write/find a tool to convert from AMD/commonjs to UMD.
We have jQuery and knockout bindings. We should also include an angular binding.
DDTPoint has this really weird thing that by default arithmetic affects both axis - this is almost never what you want.
We should add a syntax that looks more like this
var point = new DDTPoint(5, 10);
var newPoint = point.add(DDTPoint.X, 5);
newPoint.x
// 10
newPoint.y
// 10
Currently we listen to events like this
table.emitter.on('ddt.order', function(order) {
// order
});
This is the syntax that I think would work better
table.on('reorder', function(order) {
// order
});
This would mean that DragAndDropTable
would have to inherit from eventEmitter
(which is fine, TypeScript should take care of that for us). We'd also have to drop the 'ddt.' prefix from our events, and rename the following events.
- ddt.order => reorder
We really need to add automated testing to this library before we can release the RC.
The issue we have is a lot of the code in this library can't be easily unit tested, as it is heavy UI code. There are a few classes that can be easily unit tested, which are the following
Parts of the following classes can easily be united tested, whereas others cannot
This leaves the following classes and methods that cannot be easily unit tested and we will therefore have to find another way.
The following classes do not need to be unit tested as they don't have any extra functionality (but can't be removed for various reasons)
Right now it's possible to move table headers. This shouldn't be possible.
We want to add IE support at some point.
This is what support we have for IE at the moment
Seems to be mostly working. Some issues with table borders disappearing but we should be okay. This will be the easiest to fix.
Completely broken. Probably due to errors with the DDTCSS class not being properly supported in older browsers (due to using some new APIs for dynamically inserting selectors not existing).
This should be the first usable beta.
Right now whenever you swap a row, the order array is recalculated (by selecting all rows and mapping over them).
This could become a bottleneck for large tables. We should look at keeping an internal array of the values and swapping the values when swapping rows.
Potential issues with this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.