How to get (and later set) filter values manually?

I have a grid that is setup at init with some columns having filters in the header. I am looking to extract current filter values from from the grid so that I can save them and allow the user to load them all as a set again later.

I want to do something like:

col_idx = 0;
if (dhx_grid.hasFilter(col_idx)) {
   filter_val = dhx_grid.getFilterValue(col_idx);
}

and then at some later date…

dhx_grid.filterBy(col_idx, filter_val);

I’ve seen getFilterElement, but that says it doesn’t work for text based filters (most of mine are). Any suggestions?

Never mind. I was confusing #text_filter with #text_search. I’m using #text_filter, which works fine with getFilterElement.

This is the quick and dirty for anyone interested:

var filter_val = dhx_grid.getFilterElement(col_idx).value;