Add Id row to ajax call with jquery.dataTables.editable.js plugin
Add Id row to ajax call with jquery.dataTables.editable.js plugin
Hello,
I'm using jquery.dataTables.editable.js and I'd like to do a dinamic ajax call in order to show a dinamic select button, but I know how... How I can know the id of the row where I am? I tried with "jQuery('.row_selected').attr('id')" but didn't work
My code:
[code]
var oTable = $('#datatable').dataTable({
'bDestroy': true,
'bProcessing': true,
'bServerSide': true,
'sAjaxSource': "external.php?random="+Math.floor(Math.random()*1001),
'aoColumns': [
{ "bSortable": false, "sClass": "read_only", "bVisible": false },
{ "bSortable": false, "sWidth": "10px", "sClass": "read_only" },
{ "bSortable": true },
{ "bSortable": true },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sWidth": "80px", "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only"},
{ "bSortable": false, "sClass": "read_only" },
{ "bSortable": false, "sClass": "read_only" }
],
'aaSorting': [[ 2, "asc" ]] // default sort
}).makeEditable({
"sUpdateURL": "save.php",
"aoColumns":[
null,
{ "type": "datepicker" },
null,
{ "type": "select",
"loadurl": "select.php"+jQuery('.row_selected').attr('id'),
"loadtype": "GET",
"onblur": "cancel"
},
null,
null,
null,
null,
null,
null,
null,
null,
null
]
});
[/code]
Could you help me?
Thank you so much!
I'm using jquery.dataTables.editable.js and I'd like to do a dinamic ajax call in order to show a dinamic select button, but I know how... How I can know the id of the row where I am? I tried with "jQuery('.row_selected').attr('id')" but didn't work
My code:
[code]
var oTable = $('#datatable').dataTable({
'bDestroy': true,
'bProcessing': true,
'bServerSide': true,
'sAjaxSource': "external.php?random="+Math.floor(Math.random()*1001),
'aoColumns': [
{ "bSortable": false, "sClass": "read_only", "bVisible": false },
{ "bSortable": false, "sWidth": "10px", "sClass": "read_only" },
{ "bSortable": true },
{ "bSortable": true },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sWidth": "80px", "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only" },
{ "bSortable": true, "sClass": "read_only"},
{ "bSortable": false, "sClass": "read_only" },
{ "bSortable": false, "sClass": "read_only" }
],
'aaSorting': [[ 2, "asc" ]] // default sort
}).makeEditable({
"sUpdateURL": "save.php",
"aoColumns":[
null,
{ "type": "datepicker" },
null,
{ "type": "select",
"loadurl": "select.php"+jQuery('.row_selected').attr('id'),
"loadtype": "GET",
"onblur": "cancel"
},
null,
null,
null,
null,
null,
null,
null,
null,
null
]
});
[/code]
Could you help me?
Thank you so much!
This discussion has been closed.