How to modify an AJAX call with data from a datable entry...

How to modify an AJAX call with data from a datable entry...

glawrieglawrie Posts: 18Questions: 3Answers: 0
edited August 2015 in Free community support

I'm trying to populate a 'sliding child' row in a datable using an AJAX call to obtain the data, and having difficulty working out how to get it to work. I'd value any pointers etc.

The data in the table itself is very simple - just three columns, one hidden - so vendor name product name rowID - and is generated when the page HTML is drawn. I'm using javascript based on the 'sliding child rows' example to add a clicker to each row and animate the addition of the child row.

The change to the example is that rather than reformat data downloaded when the table was created (and hidden) to populate the child row, I want too get this via an ajax lookup: the data required is available via a URL of the form /ajax/entry/{rowID} - where {rowID} is the server generated value hidden when the table was generated.

I can pull the data to the created child table via an ajax call of the kind $('#data-insert').load('ajax/entry/{rowID} #data'); but I cannot work out how to get the appropriate row value from data tables to the ajax call when the user clicks on the row expander.

Sorry if this kind of confusing, but not great at javascript (as I'm sure is clear) or data tables...

This discussion has been closed.