The SetView function was registered on the onload event of the contact form and a parameter of 'All' was passed to set the view
function SetView(Value) { SetDefaultView = function (viewCombo, viewName, appGrid) { if (viewCombo.value != viewName) { viewCombo.value = viewName; } } /*I don't think this is actually needed, too lazy to check */ areaActivitiesFrame_OnReadyStateChange = function () { if (this.readyState == "complete") { var frame = getiFrame("areaActivitiesFrame"); var viewCombo = frame.contentWindow.document.getElementById("crmGrid_Contact_ActivityPointers_datefilter"); var appGrid = frame.contentWindow.document.getElementById("AppGridFilterContainer"); if (viewCombo.readyState == "complete") { SetDefaultView(viewCombo, defaultValue, appGrid); } else { viewCombo.onreadystatechange = function () { if (this.readyState == "complete") { SetDefaultView(this, defaultValue, appGrid); } } } } } if (document.getElementById(navActivities) != null) { document.getElementById(navActivities).onclick = function () { loadArea(this,"areaActivities"); var iframe = getiFrame(areaActivitiesFrame); iframe.onreadystatechange = function () { if (this.readyState == "complete") { var frame = getiFrame("areaActivitiesFrame"); var viewCombo = frame.contentWindow.document.getElementById("crmGrid_Contact_ActivityPointers_datefilter"); var appGrid = frame.contentWindow.document.getElementById("AppGridFilterContainer"); if (viewCombo.readyState == "complete") { SetDefaultView(viewCombo, defaultValue, appGrid); } else { viewCombo.onreadystatechange = function () { if (this.readyState == "complete") { SetDefaultView(this, defaultValue, appGrid); } } } } } } } } function getiFrame(iframeName) { var frames=document.getElementsByTagName('iframe'); for(var i =0 ; i < frames.length;i++) { if (frames[i].name == iframeName) { var theFrame = frames[i]; } } return theFrame; }
No comments:
Post a Comment