TableDnD
TableDnD copied to clipboard
OnDrop not called When some problems of id of <tr>.
Such as the same id of <tr>
,
<tr id="1">first row<tr>
<tr id="1">scond row<tr>
or no id of <tr>
.
<tr>first row<tr>
<tr>second row<tr>
And there is no error info or instructions about these errors.
Hi @WeiweiQi
If you have duplicate ids, then getElementById
won't work and your HTML is invalid. Can you add unique ids to your rows? Does it work if you do?
Hi @WeiweiQi
If you have duplicate ids, then
getElementById
won't work and your HTML is invalid. Can you add unique ids to your rows? Does it work if you do?
Yes, the first time when tableDnd not work is because of no id of row. Just advise when something wrong, maybe some logs in the console is better. Not know much about javascript, but row can be moved when no id or duplicate ids, so logically, the error can be detected when it happens.
I agree with Wei. There should be some indication, either in the console or the documentation that a unique ID on reach row is required. I just spent 30 minutes trying to figure out why the onDrop wasn't being called.
Not complaining, cause I appreciate the plugin, but just giving some feedback. Thanks!
@vincentwansink, if you want to take a stab at writing some extra documentation and/or implementing this error message in the console I'd be happy to merge it in for you :)
Actually I think on your Github page, in the Getting Started section, right before the HTML sample code and right after the words "but it works fine with these too):" I would just add "Important: Every row in the HTML table must have a unique ID."
I think that should be clear enough.
Hi @vincentwansink, that'll be easy for you to do. You can edit that file on GitHub now and make your changes then submit them to us as a Pull Request. We'll merge that in for you.