Closed simonzack closed 11 years ago
Hello,
Yes this would definitely be an improvement. I will take care of this soon, but I you do it before, don't hesitate to share ;)
Hi,
I'm doing this right now for version 1.0.10 :p seems like 1.0.11 is nearly ready for release, I'll post the changes once I get it all working
Thanks!
BTW, 1.0.11 is already released (available in the downloads). I had forgotten to push the tags, I just did it.
I've updated the code so it uses eventListeners for v1.0.11 something I also noticed is some custom dom properties are set for elements, say .isEditable, which greasemonkey doesn't support changed this to setAttribute to make demo.js work you'll need to change "cell.rowIndex" to "cell.parentNode.rowIndex - editableGrid.nbHeaderRows" on line 115 makes things a bit more complicated, but compatible with dom :)
http://www.mediafire.com/?0k4m99litw3tm1q
hope you accept the changes
Hello,
Thank you!
Il had a look at the proposed changes. While I agree on both ideas (use event listeners and avoid custom dom properties to make it compatible with Greasemonkey), I'll need some time before merging the changes, in order to find a clean solution to keep this compatible.
We indeed have a lot of code in production that is using EditableGrid and which I do not want to change, and the same for other users of the library. A library must stay backward compatible when possible, or users will not be happy ;)
I am thinking of an advanced config option "useCustomDomProperties" which would be true by default to ensure backward compatibility. If useCustomDomProperties is set to false (as in your case) you would have to replace "cell.rowIndex" with "cell.getAttribute('rowIndex')". Will take care of this ASAP.
I am reopening the issue until this is done.
Hi,
Since I'm quite busy for the moment, I created a branch "smk64" with your changes. I will merge this branch in the master branch asap, doing the needed changes to keep compatibility with existing code.
Hi,
Is it possible to change the onclick, onblur, and other events to addEventListener? I use this for greasemonkey, which does not support setting on* due to xpcnativewrapper
thanks, love the lib