DataTables editable plugin with server-side data and select lists

DataTables editable plugin with server-side data and select lists

matbeardmatbeard Posts: 22Questions: 0Answers: 0
edited November 2011 in Plug-ins
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

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    Can you either post the full client-side code or even set up a mock client-side only version on live.datatables.net ?
  • matbeardmatbeard Posts: 22Questions: 0Answers: 0
    Hi,

    Sorry, ignore me -- just going through the process of writing a response highlighted my problem.

    Working as it should now. Thanks.
  • mikedmiked Posts: 43Questions: 3Answers: 0
    @matbeard - what was your problem, and how did you fix?
  • matbeardmatbeard Posts: 22Questions: 0Answers: 0
    miked,

    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.
This discussion has been closed.