gnab / editablecell Goto Github PK
View Code? Open in Web Editor NEWA component for turning table cells into selectable, editable cells, behaving much like cells in Microsoft Excel.
License: Other
A component for turning table cells into selectable, editable cells, behaving much like cells in Microsoft Excel.
License: Other
Things I think need clarification:
I'm assuming we want to follow semantic versioning because we're down like that?
At least according to the spec, if you've got a version in production, you're already at 1.0.0. So perhaps we should bump the major of master to 1, and (when/if) we promote develop to master, mark that 1.1?
I've signed up for a free MyGet subscription (for open-source contributors) which is how @object builds his Simple.OData.Client library.
Editable cells may exist in both the thead and tbody. Navigation should work across thead/tbody boundaries.
Working on a small side-branch to look at more modern javascript styling. Wonder what you think?
See, for example, selection.js
Took a while to figure out some of the scoping issues. One of the things it helps clear up is where editableCell was relying on implicit this
being set in kinda-confusing ways. Note that in the above, I did convert all the functions to hang off the prototype (for ease in conversion), but obviously some of the ones which don't have a dependency on range, etc., could go back to being stand-alone functions.
I'd also like to bring in some of the bite-size pieces of lodash to simplify some of the iteration, etc.)
Comments?
Once a value is written by editableCell, there's no way to return to a null value. For some implementers, null is a valid value, and we should provide a key/key combination to signal "write a null back"
Note that this doesn't mean that the underlying observable's validation will be bypassed. If you use an knockout extender, for instance, that ensures the observable is a number, you'd need to either:
I have a request regarding the simple copy function via a normal shortcut.
If I have a image in a html table with a simple img balise, this balise refer to this image via a link, In a normal html table I can copy paste and I will get the image copied as well. In editableCell I have nothing.
Do you think it would be possible to implement this ?
Thanks for the great job.
The repo is 'editableCell', The docs say 'knockout.editableCell'. For things like bower and npm, we should agree on the general name.
The main issue going forward is whether the name should reflect the connection to knockout or not. I know @gnab was planning to disentangle some of knockout.
In addition, at least in bower, a lot of packages are 'ko-{something}'.
In managing my other project, I looked at the Knockout build steps, and they have something similar to the following (except included as a Grunt task, so the version is automatically determined by tweaking the bower.json):
To publish, run:
git add bower.json
git add -f out/*
git checkout HEAD
git commit -m "Version {version} for distribution"
git tag -a v{version} -m "Add tag v{verson}"
git checkout master
git push origin --tags
This allows them to exclude the out/dist folder completely, and then just include it (without affecting future commits) only for the tags.
Thoughts?
Hello!
We have an issue when loading Knockout via require; editableCell fails to load, since it expects ko to be a global (i.e., window) variable.
I've created a minimal reproduction of the problem here: https://github.com/jstclair/ec-amd-bug
After cloning the repo,
npm install -g gulp typescript bower http-server
The last one is optional, but I'm going to assume it's installed later.
npm install
bower install
gulp
http-server src/
Open a browser to http://localhost:8080/
EditableCell is working! This, however, is due to the preEditableCell.js script (in the src/vendor folder) and a shim (in the src/app/require.config.js file).
http-server dist/
Opening a browser, you will see it doesn't work.
Espen and I have cloned the editableCell repo and tried to change options in the browserify config in order to force editableCell to externally require knockout, but the only thing we've been able to accomplish is including the entire knockout.js script in editableCell (not our preferred solution).
Any help would be greatly appreciated!
Is there any reason why develop is so far ahead?
How is this different from contenteditable
?
IE does not support self.element.scrollIntoViewIfNeeded();
js\knockout.editableCell.js - 395
Should create a bower and publish a bower package
Is there an explicit license associated with editableCell? Shouldn't we do that?
There's an infinite loop where the navigation logic tries to advance if the parent element is null. Will update issue with more details when I find the original fix we did
Hidden cells should:
When the focused cells becomes hidden (blur + offsetHeight == 0), the first visible cell above it should get the focus.
Some implementers have implemented a virtual table; navigation of editableCell depends upon the ability to find the previous/next row or column. It would be nice to bake in a extensibility model here, so implementers can communicate with the bounds checking in editableCell and adjust their current "virtual" posiition before editableCell decides it can't move further.
I'm trying to use this plugin in a node-webkit project and I'm using RequireJS to load all of my dependencies. After adding editableCell to the project I get:
"Uncaught Error: Cannot find module 'knockout'", source: module.js (338)
It looks like the Require code setup doesn't work with the option of leaving "require" to nodejs and using "requirejs" instead.
If a user clicks at least 3 times in an editable cell field and then navigates away from that field the follow error occurs: Uncaught TypeError: undefined is not a function
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.