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.
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”);
[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.