Disable Jeditable on a single Column?
Disable Jeditable on a single Column?
Hi everyone
I have spent the past 7 hours trying to work out how to disable jeditable to a single column
I have read probably around 20 pages from google and cannot get any solution to work. The that seemed to work in 2011 is as follows:
[code]
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [1] }
]
[/code]
However after setting the class to each td cell to readonly, it still does not work. Has anybody managed to work out a solution?
Cheers!
Ryan
I have spent the past 7 hours trying to work out how to disable jeditable to a single column
I have read probably around 20 pages from google and cannot get any solution to work. The that seemed to work in 2011 is as follows:
[code]
"aoColumnDefs": [
{ "sClass": "readonly", "aTargets": [1] }
]
[/code]
However after setting the class to each td cell to readonly, it still does not work. Has anybody managed to work out a solution?
Cheers!
Ryan
This discussion has been closed.
Replies
For anybody else that is looking for a solution please see this code
The key is 'td:nth-child(2),td:nth-child(3). this will allow column 2 and 3 to be editable!
Cheers :)
[code]
$(document).ready(function() {
/* Init DataTables */
var oTable = $('#prospecttable').dataTable();
/* Apply the jEditable handlers to the table */
$('td:nth-child(2),td:nth-child(3)', oTable.fnGetNodes()).editable( 'assets/plugins/jeditable/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px"
} );
} );
[/code]