fnUpdate with fnRender
fnUpdate with fnRender
Hi,
I have searched the forum but I cannot find a soultion to this.
I have a table where one row is images (there are several images but I have simplified the code below) with onclick-events handled by fnRender to call javascrip:viewDetalail(row9).
This works perfect, but after I have done an update using fnUpdate the function call is performed with the parameter undefined/null. Is there anything I can do to fix this?
[code]
// Initialise datatable
var oTable = $('#dt_example').dataTable({
"aaData": data.member_list,
"iDisplayLength": 10,
"aaSorting": [[ 3, "asc" ], [ 2, "asc" ]],
"sDom": 'T<"clear">lfrtip',
"aoColumns": [
{ 'sTitle': 'row0', "sClass": "left" },
{ 'sTitle': 'row1', "sClass": "left" },
{ 'sTitle': 'row2', "sClass": "left" },
{ 'sTitle': 'row3', "sClass": "left" },
{ 'sTitle': 'row4', "sClass": "left" },
{ 'sTitle': 'row5', "sClass": "left" },
{ 'sTitle': 'row6', "sClass": "left" },
{ 'sTitle': 'row7', "sClass": "left" },
{ 'sTitle': 'row8', "sClass": "left" },
{ 'sTitle': 'row9', "sClass": "left", "sWidth" : "120px",
"fnRender": function ( oObj ) {
return '';
}
},
{ 'sTitle': 'Active', "sClass": "left", 'bVisible': false }
]
});
...
// Update a row
oTable.fnUpdate( [em_id, id, ep_firstname, ep_lastname, ep_adress, ep_zip, ep_city, em_year, em_date, em_id, em_active, currRow, 0, 1, 1 );
[/code]
Thanks
//Anders
I have searched the forum but I cannot find a soultion to this.
I have a table where one row is images (there are several images but I have simplified the code below) with onclick-events handled by fnRender to call javascrip:viewDetalail(row9).
This works perfect, but after I have done an update using fnUpdate the function call is performed with the parameter undefined/null. Is there anything I can do to fix this?
[code]
// Initialise datatable
var oTable = $('#dt_example').dataTable({
"aaData": data.member_list,
"iDisplayLength": 10,
"aaSorting": [[ 3, "asc" ], [ 2, "asc" ]],
"sDom": 'T<"clear">lfrtip',
"aoColumns": [
{ 'sTitle': 'row0', "sClass": "left" },
{ 'sTitle': 'row1', "sClass": "left" },
{ 'sTitle': 'row2', "sClass": "left" },
{ 'sTitle': 'row3', "sClass": "left" },
{ 'sTitle': 'row4', "sClass": "left" },
{ 'sTitle': 'row5', "sClass": "left" },
{ 'sTitle': 'row6', "sClass": "left" },
{ 'sTitle': 'row7', "sClass": "left" },
{ 'sTitle': 'row8', "sClass": "left" },
{ 'sTitle': 'row9', "sClass": "left", "sWidth" : "120px",
"fnRender": function ( oObj ) {
return '';
}
},
{ 'sTitle': 'Active', "sClass": "left", 'bVisible': false }
]
});
...
// Update a row
oTable.fnUpdate( [em_id, id, ep_firstname, ep_lastname, ep_adress, ep_zip, ep_city, em_year, em_date, em_id, em_active, currRow, 0, 1, 1 );
[/code]
Thanks
//Anders
This discussion has been closed.
Replies
Events demo: http://datatables.net/release-datatables/examples/advanced_init/events_live.html
Allan
[code]
$('img.details').click( function() {
...
});
[/code]
It works perfectly but the problem is, how do I get the row information there? What I need is an identifier from one of the columns.
Anders
[code]
$('td img.details').click( function() {
var aData = oTable.fnGetData( this.parentNode.parentNode );
alert(aData[1]);
});
[/code]
Any ideas?