cell.invalidate() error
cell.invalidate() error
idleog
Posts: 6Questions: 1Answers: 0
in Bug reports
Hi
I have following problem:
Calling a cell.invalidate() throws error line 1671
TypeError: row.getAttribute is not a function
var id = row.getAttribute( 'id' );
I'm doing:
api.on('click','.btn',function() {
.... [changing some content in cell]
var cell = api.cell(me.closest('td'));
console.log(cell.data());
cell.invalidate();
...
Latest Firefox/Chrome on Mac
DataTables 1.10.8
http://debug.datatables.net/ibipoz
Did I miss something?
Cheers, Peter
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Where are you setting 'me' and what is the output of the console.log call?
I think you want
$(this).closest('td')
'me' is referenced to $(this) (which is the button triggering the event within the cell).
Console output is the actual html string of the cell.
Check this live tables example.
http://live.datatables.net/japiteto/1/edit
Only the cell for Garret Winters has the on click event.
I think it is doing what you are looking for and does not throw an error.
thanks, ThomD
It works in the live example, but after clicking on Garret Winters, when I switch a panel (e.g. css) an alert is shown:
And: When I go back to DataTales 1.10.7, It works in my example. The cell is invalidated without error.
No - a bug in DataTables 1.10.8 :-(.
This commit yesterday fixed it, and it is available in the dist repo. The nightly doesn't include this fix yet - I'm working on updating the way the nightlies work,s o they will be a bit out of date until I'm done with that work.
Sorry for the trouble!
Allan
thanks, Allan
That fixes the error.
But: after call cell.invalidete(), on next action (like search, rowreorder, I think when draw() is called), I get following alert:
DataTables warning: table id=goe-indextable - Requested unknown parameter '0' for row 1. For more information about this error, please see http://datatables.net/tn/4
http://debug.datatables.net/avajev
Could you possibly give me a link to the page so I can debug it please? Unfortunately the debugger doesn't give enough information for this case.
Allan
Here is a link: http://schmuck.goeldi-web.ch/schmuckadmin/categories
Use an eye-button to trigger an invalidate event. Then reorder rows (dragging first column) or use the search field.
Cheers, Peter
Hi Peter,
Fantastic - thank you for the test case. I've just committed the fix and the dist repo has been synced with the source. If you use the DataTables file from the dist repo the issue should be resolved.
Regards,
Allan
Perfect!
Thanks, I very appreciate your work!
Cheers,
Peter