I can't retrieve cell id from table to update, I'm using dataTable().makeEditable to edit in place

I can't retrieve cell id from table to update, I'm using dataTable().makeEditable to edit in place

ng_alex2003ng_alex2003 Posts: 2Questions: 0Answers: 0
edited August 2012 in General
Hi everyone ,

I hope someone can help me with this problem. I'll be brief so I don't bore you, so basically I have a table, information in that table is retrieved from a database and it consist of numbers mainly (e.g: 7.89).
Now I have used dataTable to sort information and all other feature and I want the user to be able to edit information in place so I've added .makeEditable (jquery.jeditable.js and I've also loaded jquery.dataTables.editable.js).
I can double click on a cell change the value and send the value to a page through ajax to make the update.

The PROBLEM is that I can't retrieve cell id (td), ok I can retrieve cell position in table (td position in tr), row id (tr), I can get column name and so on, but again I want to get td "id" (e.g.: ). I have searched the forum and google for several days now so if you could help my I would be grateful.

Here is the code, this is the basic version. I should mention that I don't know td position because I'm generating the table dynamically, I mean that I'm also using "FixedColumns.js" because columns and table rows are different from user to user, I mean a user can add as many columns as he wishes. I the example bellow I have only 16 columns.

[code]
$(document).ready(function() {
var oTable;

oTable = $('#myTable').dataTable({
"bScrollCollapse": true,
"iDisplayLength": 50,
"bJQueryUI": false,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fp>'
}).makeEditable({
sUpdateURL: function(value, settings) {
return(value); //Simulation of server-side response using a callback function
},
"aoColumns": [
null,
null,
null,
null,
<?php for($i=0;$i<12;$i++) : ?>
{
indicator: 'Salvare...',
tooltip: '',
placeholder: 'Click to edit',
type: 'text',
onblur: 'submit',
sUpdateURL: "contor/update-contor",
}<?= ($i != 11) ? ',' : ''; //put comma except last one ?>
<?php endfor; ?>
]
});
});
[/code]


This is working fine, I have no problem with FixedColumns.js but I've put it here just because is on the same page with the above code

[code]
$(document).ready(function() {
var oTable;

oTable = $('#contorApa').dataTable({
"sScrollX": "200%",
"sScrollXInner": "250%",
"bScrollCollapse": true,
"iDisplayLength": 50,
"bJQueryUI": false,
"bRetrieve":true,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fp>',
"aoColumnDefs": [
{ "bVisible": true, "aTargets": [ 5 ] }
]
});
new FixedColumns( oTable, {
"iLeftColumns": 4,
"iLeftWidth": 400
});
});
[/code]
This discussion has been closed.