Using toArray(), Is there a way to select all rows and a subset of columns using named columns?
Using toArray(), Is there a way to select all rows and a subset of columns using named columns?
msand01
Posts: 54Questions: 24Answers: 1
I have played around with the syntax but to no avail. For example, I tried this, but I still get all columns:
var myData = table.rows().columns(['ID:name', 'Status:name']).data().toArray();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
rows()
selects rows,columns()
selects columns - they do not take an intersection of the two! For that usecells()
which will do what you want (although it will get the data in a flat array - is that want you want? If not, then you need to use a loop on therows()
method (i.e. loop over each row, getting the data you want for it)).Allan