Click on row does not work using sAjaxSource
Click on row does not work using sAjaxSource
librarymark
Posts: 4Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
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
Later -
Library Mark