fnRender, button with onclick

fnRender, button with onclick

handbuchhandbuch Posts: 55Questions: 0Answers: 0
edited October 2010 in General
Hi, here's my code:
[code] bTable = $("#tableAddCategories").dataTable( {
"bPaginate": false,
"bRetrieve": true,
"bFilter":false,
"bInfo": false,
"sAjaxSource": "files/scripts/GetJSON_Categories.php",
"aoColumnDefs": [{
"fnRender": function ( oObj ) {
return \'\';
},
"aTargets": [ 0 ]},
{
"bVisible": false,
"aTargets": [ 2]
}]
});[/code]

i want to get the onclick working, how can i do that? if it is not possible, whats a good work around? and dont wonder about the \

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The escape character before starting the string looks odd - and I'd be surprised if that doesn't give a Javascript error. The basic idea looks okay, although I'd always recommend using jQuery events rather than DOM0.

    Allan
  • handbuchhandbuch Posts: 55Questions: 0Answers: 0
    edited October 2010
    hmm, yeah, it works now if i call a selfmade function wit hthe onclick, but thats fine. but how do i get the value of the row in which the button is? i dont get it. with checkboxes it works but not with buttons, why that?

    and how could i use a jquery event? $(#mybtn).click? or something like that? since i fill the table dynamically its very handy to just call the onclikc instead of doing some loops to get the event working. or can i say, if any button in the form x is clicked get its value?

    got it, just with onclick=myfunc(this.name/value);

    thanks =)
This discussion has been closed.