Calling a function from a hyperlink

Calling a function from a hyperlink

watherswathers Posts: 6Questions: 1Answers: 0
edited August 2013 in General
I there, I am using fnRowCallback function to draw a hyperlink as follows:

"fnRowCallback": function(nRow, aoData, iDisplayIndex, iDisplayIndexFull) {
$('td:eq(0)', nRow).html('

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited August 2013
    If test2 is meant to be a string, it needs to have quotes around it. Its not really DataTables specific, but in general I'd strongly recommend you don't use DOM0 events (onclick etc) and use jQuery events instead.

    Allan
  • watherswathers Posts: 6Questions: 1Answers: 0
    Thanks Allan. I use jquery click event and then hooked it up to a listener. One concern I have, which I'm hoping you can alleviate, is in relation to how server side processing works as a whole. For example, whenever I make a search am I in essence returning all the data again from the database ? The reason i ask, is that I am usingDT to load a specific date range worth of data into the table, but then only want to filter on what is present. Is this possible?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > For example, whenever I make a search am I in essence returning all the data again from the database

    No - with server-side processing you are loading old the data for the current page. Not the full data set (that's the whole point of server-side processing!).

    If you are using server-side processing, filtering is done at the server - it is no way to filter just want is at the client (i.e. you cannot mix client-side and server-side processing). Whatever is doing the processing needs the full data set.

    Allan
  • watherswathers Posts: 6Questions: 1Answers: 0
    Nice one Alan. I guess one thing I need to monitor is the amount of XHR calls, and to ensure that my connection objects are properly managed, I.e closed etc. great stuff
This discussion has been closed.