Proper way to bind function to modified cell content?
Proper way to bind function to modified cell content?
I am init'ing a table thus:
"[code]
var oTable = $('#loadRow').dataTable( {
"aoColumns": [
/* id */ { "bVisible": false },
/* icon */ { "fnRender": function ( oObj ) {
var shtml= oObj.aData[0];
if(isNumber(shtml)){
var sspan = "";
return sspan;
}
} },
/* latlng */ { "bVisible": false },
/* Site Name */{ "bSearchable": true},
/* Phone */null,
/* Address (Line 1) */null,
/* Address (Line 2) */null,
/* City */null,
/* State */null,
/* ZIP */null],
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
} );
"[/code]
...which works swimmingly. I am then wanting to bind a function to the click event for class='ui-icon ui-icon-circle-close' .
I have tried applying the bind after both the ""fnInitComplete"" and "fnRowCallback" callbacks and nothing seems to work.
I have also searched the forums for a "bind" example and this is all htat I have manged to turn up thus far:
http://datatables.net/forums/comments.php?DiscussionID=583&page=1#Item_0
TIA.
Shameless
/////////////////////////////////////////////////////////////
The solution that I found was to use the JQuery "live()" function. There might be a more elegant method, but "live" works.
/////////////////////////////////////////////////////////////
"[code]
var oTable = $('#loadRow').dataTable( {
"aoColumns": [
/* id */ { "bVisible": false },
/* icon */ { "fnRender": function ( oObj ) {
var shtml= oObj.aData[0];
if(isNumber(shtml)){
var sspan = "";
return sspan;
}
} },
/* latlng */ { "bVisible": false },
/* Site Name */{ "bSearchable": true},
/* Phone */null,
/* Address (Line 1) */null,
/* Address (Line 2) */null,
/* City */null,
/* State */null,
/* ZIP */null],
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
} );
"[/code]
...which works swimmingly. I am then wanting to bind a function to the click event for class='ui-icon ui-icon-circle-close' .
I have tried applying the bind after both the ""fnInitComplete"" and "fnRowCallback" callbacks and nothing seems to work.
I have also searched the forums for a "bind" example and this is all htat I have manged to turn up thus far:
http://datatables.net/forums/comments.php?DiscussionID=583&page=1#Item_0
TIA.
Shameless
/////////////////////////////////////////////////////////////
The solution that I found was to use the JQuery "live()" function. There might be a more elegant method, but "live" works.
/////////////////////////////////////////////////////////////
This discussion has been closed.
Replies
Regards,
Allan