I am trying to edit my rows in my datatable but I am not able to figure out a way to use the below example in my tables.
var myTable = $('#myTable').DataTable();
myTable.cells( '.selected' ).edit();
Hi @mihal ,
Are you using Editor - as edit() is part of that extension. If not, you can use cells().data() to change the data in a specific cell.
I am not using Editor. Can you please provide an example for cells().data() API.
Colin has an example in this thread:
Hey @kthorngren ,
I am trying to do editing which can be of any kind of editing on the data tables.
This is a example which I have, I am looking to apply editing for rows in this data table.
Are you trying to do inline editing or using a form?
Are you wanting buttons in the row that allow for edit and delete of that row? If so this example should help:
Or are you wanting the edit buttons like a typical Editor config:
There's lots of ways to do this if you don't want to purchase the Editor. Maybe you can update your example to show what you want to do and we can help from there.
Yes I am looking to do something really simple by editing the row.
I think the above link is not working as its not allowing to edit the row.
Its not meant to allow editing. Its a simple example I have to show how to use buttons within a row. You will need to write the code to handle the editing of the data. The example shows you how to get the row data. Its up to you to present the editing for then to handle updating the Datatable with the changed data and, if needed, sending to the server for permanent storage.
Another option is to purchase the Editor. $119 is a small price to pay to not have to code the editing of a table. Want to mention that I'm not employed by Datatables
Yeah I know, Kevin you have always been a great help. I will try to do it.
If yuo are going to try yourself I suggest you start with the example you posted:
You won't be able to save the data to a DB but you will be able to build most of what you want. And as you have questions we can easily take a look because you will have the test case.
@minhal: DT's Editor pays for itself in terms of the time you'll save.
I don't work here either!
Thanks @kthorngren and @tangerine for you advice.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.