Jeditable for one column?
Jeditable for one column?
I see the example for JEdit: http://datatables.net/examples/api/editable.html.
My problem is I just need it for one column?
My datatable has 6 columns and the last column would need to be editable for comments.
I tried a simple approach of placing a div in column. It did not work, do I need to approach it differently?
// html
[code]
Lorem ipsum dolor sit amet, consectetuer
[/code]
//this is the JQuery stuff
[code]
var oTable;
$(function () {
oTable = $('#calendarTable').dataTable({
"bPaginate": false,
"bSort": false,
"bFilter": false,
"bInfo": false,
"aoColumns": [
null,
null,
null,
null,
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false }
]
});
$('ul#quarters').appendTo('.dataTables_filter');
q1();
$('.edit_area').editable("save.asp", {
type: 'textarea',
cancel: 'Cancel',
submit: 'OK',
indicator: '',
tooltip: 'Click to edit...'
});
});
[/code]
My problem is I just need it for one column?
My datatable has 6 columns and the last column would need to be editable for comments.
I tried a simple approach of placing a div in column. It did not work, do I need to approach it differently?
// html
[code]
Lorem ipsum dolor sit amet, consectetuer
[/code]
//this is the JQuery stuff
[code]
var oTable;
$(function () {
oTable = $('#calendarTable').dataTable({
"bPaginate": false,
"bSort": false,
"bFilter": false,
"bInfo": false,
"aoColumns": [
null,
null,
null,
null,
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false }
]
});
$('ul#quarters').appendTo('.dataTables_filter');
q1();
$('.edit_area').editable("save.asp", {
type: 'textarea',
cancel: 'Cancel',
submit: 'OK',
indicator: '',
tooltip: 'Click to edit...'
});
});
[/code]
This discussion has been closed.
Replies
multiple things you can do:
1) you can use the editable plugin, but set all the values in .makeEditable() to null except the column you want
2) set a sClass on your desired column and call .editable() on that class
3) I forgot what I was going to say for #3, but I think your div idea should work..
Thank you, you got me in the right direction.