Filter Value to be saved in Dropdown box after page reload

Hi!

How do we save the value of the filter in the dropdown /select_filter after the page reloads ?

We have used cookies to save the filter. Everything works apart from when the user selects a filter and loads the page then the dropdown shows blank. It should show the selected filter.

eg. if he filters the column by First Name and loads the page then the column shows only the firstname but the dropdown box is blank…it should show First Name so it is clear to the user that only First Names are being showed.

Thanks

Please, try to use:
val=grid.getFilterElement(colInd).value
to save the value of the input

grid.getFilterElement(colInd).value=val
to set the value to the filter input

Hi!

Can you give with an example ? Thanks

[code]
Code so far…

var f_ind=[];
var f_data=[];

mygrid.attachEvent("onFilterStart",function(ind,data){
var val=mygrid.getFilterElement(6).value;
//alert("Jim "+ mygrid.getFilterElement(6).value);
//alert(val + "Location DD");
setCookie("location_filter",mygrid.getFilterElement(6).value,365);
setCookie("awaiting_filter",mygrid.getFilterElement(7).value,365);
setCookie("filter_dd",val,365);

return true;
});

mygrid.parse(xmlstr, function checkCookie(){
var first=getCookie(“inbox”);
if (first!=null && first!="")
{
//alert("Welcome again ");
var filter_cookie=getCookie(“location_filter”);
var filter_cookie2=getCookie(“awaiting_filter”);
var filter_cookie3=getCookie(“filter_dd”);

if (filter_cookie!=null && filter_cookie!=""){

mygrid.filterBy(6, filter_cookie, true);
mygrid.getFilterElement(6).value=val;
}
if (filter_cookie2!=null && filter_cookie2!="") {
mygrid.filterBy(7, filter_cookie2, true);}
}
else
{
setCookie(“inbox”,“visited”,365);
}}[/code]

Hi! We seem to have fixed it thanks…

[code]We were using this
mygrid.getFilterElement(6).value=val;

instead of

mygrid.getFilterElement(6).value=filter_cookie3; (refer to the code)[/code]

But we have another issue. After we move the column with the filter to another position, the filter value in the drop down gets set (perfect) but it doesn’t filter the items.

eg. After column 6 is moved to 4.

Please, try to load your column order at the last when all other operations are applied.