Unable to activate inline editing for my DataTable Editor.
Unable to activate inline editing for my DataTable Editor.
The attached code works well for displaying database information and allows the user to select a single field and use an Edit button to Update data. I'm trying to enable inline editing for just the "Billed" cell/field and am unable to do so. I used examples at the DataTables site for help, but am apparently missing something. I had to attach a text file which lists code from two files as I was unable to submit this post due to too many characters in the body of the question.
Anyone notice anything I'm missing?
Thank you.
This question has an accepted answers - jump to answer
Answers
My guess would be that you are invoking the listener before adding the class to the column:
You probably will need to move the event listener after the DT init. You might need to put it in
initComplete
to make sure its run after the class has been assigned. It seems this would work but I've always specified the columns that are enabled or disabled.Kevin
That shouldn't actually matter in this case since the
tbody td.editable
is part of the delegate target. As long as those elements exist when clicked and#job_table
exists when that line is run it should work okay.I actually don't see why that isn't working.
Are there any errors shown in the console with you click?
Allan
Kevin, thank you for your assistance and suggestions. I tried moving the event listener into initComplete, but still no luck. I suspect it's something else I'm overlooking.
I had a feeling it was something easy and overlooked by me. I forgot to change the name of the editor variable from editor to jobEditor. I copied & pasted code, but forgot to make my edits.
Thank you Kevin and Allan for your replies.
Should actually be... I changed 'editor.inline( this );' TO 'jobEditor.inline( this );'
Gah. Well found. Good to hear you've got it working now.
Allan