Click on row does not work using sAjaxSource

Click on row does not work using sAjaxSource

librarymarklibrarymark Posts: 4Questions: 0Answers: 0
edited September 2010 in General
Hello -

I am new to jquery and datatables. I thank everybody who made them both possible.

I am trying to create a web-based print metering solution for the library I work at. All is going very well, the table that I am using to display print jobs works as it should. I have it set so that when I click on a row, the row turns color and is selected to print. I am using PHP and mysql, and the page loads the print job data as html. Right now, when data changes (a job is printed, a job is changed from color to BW, etc) I have to reload the whole page to see the change. I would like to be able to just reload the table data.

When I try to us sAjaxSource in the table definition, I can pull in the data, but nothing happens when I click on a row. The click event never fires. What am I missing?

Thanks again!

Library Mark

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Thanks for the kind words :-)

    My guess is that the event handler simply isn't being applied. Have a look at the FAQ entitled "Q. My events aren't being applied" (it's under the server-side processing section, but I believe it still applies): http://datatables.net/faqs . $().live() is likely to be the easiest solution if you are just using $().click() etc.

    Visual Event can be useful for seeing what elements have events attached to them: http://www.sprymedia.co.uk/article/Visual+Event .

    Allan
  • librarymarklibrarymark Posts: 4Questions: 0Answers: 0
    Thanks, Allan - $().live() did help. I am able to load the data and some of the events are firing, but some aren't, so I've got some troubleshooting to do, but you've set me on the right track. I never would have been able to do this project without jquery and DataTables. Visual Event is cool, too. You guys are geniuses!

    Later -

    Library Mark
This discussion has been closed.