webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
796 stars 271 forks source link

demo_attach.html issue #5

Closed jasvazquez closed 13 years ago

jasvazquez commented 13 years ago

If you use E{nnn} as row id in the html table (instead of the numbers you used) the demo throws an "tr is null" error and doesn't delete the row when you click on the action column.

Look here for a complete html example [http://tinypaste.com/d2182]

webismymind commented 13 years ago

Thanks for the report.

The 'problem' is that you changed the row ID's used in demo_attach.html, but did not change the values stored in the last column of each row. Indeed, in this example, the removeRow function is called using the value stored in the last column as parameter.

This is only an example, but you're right, it can be improved to remove the redundant information. This is what I did in my last commit 5 minutes ago. I changed all row ID's to be alphanumeric (R{nnn}) and improved the CellRenderer of the 'action' column to get the actual row ID instead of relying on the value stored in the last column (as a consequence, the last column can now be left empty in demo_attach.html).

Hope this helps.

jasvazquez commented 13 years ago

You are right, I didn't change the last column (sorry) :( Your change works like a charm. Fast answer in a nice project. Thank you very much