Get all values in a column


#1

Hello,

I would like to know how to get all shown values in a column of my dhtmlx grid. I see the following method in the api collectValues (docs.dhtmlx.com/api__dhtmlxgrid_ … alues.html) but this returns all possible values, even those who have been filtered out.

So my question is, what api can I use to see all available values for a specific column, with already applied filtering taken into account.

Please let me know if you need any more elaboration on my goal.

Thanks!


Get all the values present in the grid
#2

Unfortunately the only way is to iterate through the visible rows with forEachRowA function and get the values of the cells.
Something like:

mygrid.forEachRowA(function(id){ val=mygrid.cellById(id,column_index).getValue() });


#3

Thanks for the info sematik. I can utilize your sample iteration code and create my own function to gather unique values.

I think it would be great to add this as a feature in an upcoming version. One idea is you could overload the collectValues() api so that an optional boolean parameter could be used to specify whether or not to show the filtered values.

Just a thought. Thanks again for the help!


#4

Thanks for your mote.
The suggestion will be considered.