I need to edit the dataTables jQuery code, so when I click in the editable cell, it will select whole text in the cell. I know its usually done with onclick=”this.select()”, but jQuery code is very hardly readable for me… Code I have so far (at least I understood this is the code I need to edit):
"fnDrawCallback": function () {
$('#table_dzs tbody tr td:nth-child(7)').editable( './files/save_dzs.php?stavba=<?echo $stavba;?>', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[2] );
},
"submitdata": function ( value, settings ) {
return { "id": oTable.fnGetData( this.parentNode )[0], // get the value of first row/column. In my case it is the "id" in database
"value": oTable.fnGetPosition( this )[7] // Column number
};
},
"height": "14px"
});
}
Just add this line after datatable initialization:
It’s a public dictionary for customization of editable plugin.