DataTable - Cell Editing
DataTable - Cell Editing
Hi folk, I appreciate this great plug-in.
In the following example:
http://datatables.net/examples/api/editable.html
when you try to edit a cell a appears.
It would be great if, according to the cell columns selected, appeared a different
for example: .
An example to this URL:
http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html
and try to click on "state" cell.
A little hint would be nice!
thanks,
Antonio
In the following example:
http://datatables.net/examples/api/editable.html
when you try to edit a cell a appears.
It would be great if, according to the cell columns selected, appeared a different
for example: .
An example to this URL:
http://developer.yahoo.com/yui/examples/datatable/dt_cellediting.html
and try to click on "state" cell.
A little hint would be nice!
thanks,
Antonio
This discussion has been closed.
Replies
It's quite possible to do that, it's just that DataTables doesn't provide an internal way to do it. As you can see from the example jEditable is used to add the text input, and it is quite possible to use that plug-in to get different input controls as well: http://www.appelsiini.net/projects/jeditable . There are several other 'edit-in-place' plug-ins for jQuery as well which would also work just as well.
Regards,
Allan
thank for the suggestion,
It is enough for me.
Antonio
seeing better to the jquery.jeditable.js,
seems DataTables provide an internal way to do it.
$.fn.editable can accept as "parameter type": text, option, textarea ecc...
or maybe I missed something?
Antonio
Using datatables in combination with jeditable works great for me. I just have one question:
jeditable is posting value and id to a savescript. Value is filled with the new entered value but not the id. This seems to be correct because attribut id is missing in tag. I know how to modify the class or name atribute:
[code]
"aoData" : [
{ "sClass": "addon" },
{ "sClass": "category" }
],
[/code]
Do i have a chance to set the id attribute?
@Korki: DataTables doesn't provide a method to set an ID (since you would need to do it for every cell, and then you might as well do it with standard DOM methods). You can add it just be looping over the created rows/cells if you want, or you can use fnGetPosition (and possibly other functions) to get the position and other information. See this example: http://datatables.net/examples/api/editable.html
Allan