get all values from each row

get all values from each row

Ghost108Ghost108 Posts: 19Questions: 7Answers: 0

Hello :)

here is my test example:
http://live.datatables.net/hidukase/1/edit?html,js,output

I would like to get all input values (for example as an array) after a click on the button "Save values"
Can anybody tell me, how I can realize it?
Thank you !!

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You would do something like this:

    tablePositionen.rows().data().toArray()
    

    You could need to access the val() of the input elements, but they're in the returned array.

    Colin

  • Ghost108Ghost108 Posts: 19Questions: 7Answers: 0
    edited October 2021

    sorry sorry sorry ! but how can I get the values of the input fields?

    With your code I get this array:

    I tried this but without success:

    var myArray = tablePositionen.rows().data().toArray()
    console.log(myArray);
    console.log(myArray[3].val())
    

    Okay I guess I found the way :) :

    console.log( $(myArray[0][3]).val())

Sign In or Register to comment.