DataTables editable plugin with server-side data and select lists
DataTables editable plugin with server-side data and select lists
I'm using DataTables with server-side data (from MySQL) which is working really well. I've also got a few columns using the fnRender function to combine some HTML with the cell values, which is also working well.
I'm now trying to add the final "icing on the cake" and make it editable.
I'm using the jEditable plugin and the DataTable Editable plugin to tie them together. If I stick to the default basic text boxes for editing, it's all fine, but I need to use a select list.
I'm using:[code]$('#table').dataTable( {...}).makeEditable({ sUpdateURL: 'url' });[/code] i.e. specifying makeEditable AFTER configuring the DataTable.
I've tried adding a second aoColumns array in the makeEditable options, but this is ignored and nothing is editable.
if I try the alternative:
[code]$('#table').dataTable().makeEditable( {...});[/code] I get warnings abount an unexpected number of TD elements in FireBug and the table isn't rendered. This is probably somehting to do with the 'blank' columns which use custom rendering, but I can't do without these.
Any ideas? I can post the full code if necessary.
Thanks
I'm now trying to add the final "icing on the cake" and make it editable.
I'm using the jEditable plugin and the DataTable Editable plugin to tie them together. If I stick to the default basic text boxes for editing, it's all fine, but I need to use a select list.
I'm using:[code]$('#table').dataTable( {...}).makeEditable({ sUpdateURL: 'url' });[/code] i.e. specifying makeEditable AFTER configuring the DataTable.
I've tried adding a second aoColumns array in the makeEditable options, but this is ignored and nothing is editable.
if I try the alternative:
[code]$('#table').dataTable().makeEditable( {...});[/code] I get warnings abount an unexpected number of TD elements in FireBug and the table isn't rendered. This is probably somehting to do with the 'blank' columns which use custom rendering, but I can't do without these.
Any ideas? I can post the full code if necessary.
Thanks
This discussion has been closed.
Replies
Sorry, ignore me -- just going through the process of writing a response highlighted my problem.
Working as it should now. Thanks.
Apologies, only just spotted your question...
The fix wasn't really a fix -- I had discrepancies between the number of visible columns defined in the dataTables aoColumns array and the number of columns defined in the makeEditable() settings. Once they match it works as it should.