DataTables dynamic creation example

DataTables dynamic creation example

phpnetcophpnetco Posts: 6Questions: 0Answers: 0
edited May 2011 in General
DataTables is super!

I made a donation yesterday :).

I'm totally new to jquery, I use php for all of my form processing etc...

I am needing guidance on making a row click able to a new page. I was able to get it working using server side but no luck with DataTables dynamic creation example. I like the DataTables dynamic creation better for the sorting reasons.

May I please have some guidance from a jquery/dataTable pro.

More Donations to come................

Thanks,

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Hi phpnetco,

    Thanks for the donation :-). Great to hear that DataTables is doing the job for you.

    To have a whole row clickable you can do something like this:

    [code]
    $('#example tbody tr').live('click', function () {
    window.location.href = '....';
    } );
    [/code]
    So just normal jQuery rather than using the DataTables API. Where that might come in is if you want the page change to go to an address based on the data contained in the row clicked on - in which case you can use $('#example').dataTable().fnGetData(this) inside the click function, which will give you an array of the cell information for that row.

    Regards,
    Allan
This discussion has been closed.