Proper way to bind function to modified cell content?

Proper way to bind function to modified cell content?

shamelessshameless Posts: 31Questions: 0Answers: 0
edited January 2010 in General
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.

/////////////////////////////////////////////////////////////

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Using $().live is a good solution, so is using something like in this example: http://datatables.net/examples/advanced_init/events_post_init.html (also mentioned in the FAQs).

    Regards,
    Allan
This discussion has been closed.