IBACK
1
Hi,
I have a problem with the format of the array returned by the collectValues function (used in a datatable).
code :
var my_array = $$(‘myid’).collectValues(‘column_id’);
How to list the values of my_array (values of column_id) ?
my_arrays seems to be composed of an object “id” and an object “value”.
I don’t know how to get the values.
any ideas ?
thanks
Fabrice
Helga
2
Hi,
The collectValues
method is used to get data for suggest lists used by column filters. It is expected that it return id-value
pairs.
If you need all the values for the column as simple array, you can loop through the data in such a way:
var values = [];
dtable.data.each(function(obj){
values.push(obj.column_id);
});
where column_id
is the name of the necessary column.
IBACK
3
Hi Helga,
thanks for your response.
it’s perfect.
Fabrice