Question about pluck() and column ID & ColReorder
Question about pluck() and column ID & ColReorder

Hi,
Is this possible to use pluck() with the column number
var itemId = table1.rows( { selected: true } ).data().pluck(2).toArray();
Because when using pluck(2) if the column get reordered the value is no good anymore
I have set the column not to be reordered as a quick fix.
I saw that is possible to use form field name
pluck('name')
But I'm wondering if the is possible to use it with column real ID / index
same as statesave so if let say column 9 move it is possible to retreive the data.
"ColReorder":[0,1,2,9,3,4,5,6,7,8,10]
This question has an accepted answers - jump to answer
Answers
Since you are using arrays you can use
columns.name
to provide a name for one or more columns. Then usecolumn-selector
, example code, with-column().index()
to get the column index. Use that forpluck()
. This example should help explain it:http://live.datatables.net/fovikexo/1/edit
Kevin
Thanks a lot columns.name is more reliable...
I endup with this