Getting Data from the DataTables...

Getting Data from the DataTables...

mschumacher777mschumacher777 Posts: 8Questions: 6Answers: 1

I'm working on getting a DataTables going, but has been a long process of learning DataTables, JavaScript, JQuery and such. This link takes you to what I've got so far. I've got 2 things that I need to handle:

1) Around the comment "This is what I need" in the JavaScript I'm getting this in the console.log ""<input type=\"checkbox\" path=\"selected\" value=\"761786\">"" - I need to get the "value" from it. Open to any suggestions.
2) Also around the comment, I need to get the actual row that has been checked, not the first one of the data every time.

If I need to provide a bit more information, please let me know. Michael

http://live.datatables.net/huwudifu/27/edit?html,css,js,console,output

Answers

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin

    $(this).val() should give you the value of the input element, since that is the element that your event listener is listening for. Since it is a checkbox you might be best using the :selected selector - see the jQuery documentation for details.

    Allan

This discussion has been closed.