Jeditable for one column?

Jeditable for one column?

cmanvacmanva Posts: 37Questions: 0Answers: 0
edited August 2011 in General
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]

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    (I see more than 6 columns.. ??)

    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..
  • cmanvacmanva Posts: 37Questions: 0Answers: 0
    Yeah I said six, but the existing page has 12.

    Thank you, you got me in the right direction.
This discussion has been closed.