How can I get the column value into a string variable Please help
How can I get the column value into a string variable Please help

Hi
from the following code , the result is stored as array object in to the variable report. from there how can I store 4th column data into a string variable or into a list<string> variable
var url = "/Employee/GetDepotList";
table = $('#DepotTable').DataTable
report = table.rows({ selected: true }).data();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
If I understand your question correctly you will want to use
pluck()
to get the 4th column then maybetoArray()
to get an array.Kevin
kthorngren
I applied your code but not working ,
When I debug the variable report = table.rows({ selected: true }).data(); the data is coming as given below in the image
Please can you view the image, from that value I want to get DepotNo into a string variable as '1','2','5','10' that is selected depot number of the data table
When I applied the code

var saleries = table.rows({ selected: true }).data().pluck('DepotNo'); it is showing as given
I want to store the depotno like
string _depots='1','2','3','4','5','6'
Please can you help me
This is not valid syntax. Do you want a comma separated string or an array?
If an array then chain
toArray()
as mentioned above.Kevin
Looks like this thread has been repeated: https://datatables.net/forums/discussion/59155/how-can-convert-array-value-into-string#latest