http://wiki.alphasoftware.com/~alpha...k+Property+V11
Based on reading the document above I believe I should be able to wrap code in if e.ajaxcallbacks = .f. ... end if to have it only run the first time the grid is initialize yet it keeps running on every subsequent search. Maybe I'm misunderstanding the nature of this function.
I have the following code in the OnGridExecuteEvent:
This code initializes the grid with a specific search filter and then I use this text in the OnSUmmarySEctionRender function to emit the e.rtc.initial_filter to display this filter on the screen so the user knows that the grid has been set to the first of the year. The problem is if I clear the filters it still sets the year in e.rtc.initial_filter = "01/01/2015" in the OnSummarySectionRender event even though I have set it = "" at the end of OnSummarySectionREnder event. I'm not sure if this function keeps resetting it or if it's impossible to change the original instance of e.rtc.initial_filter from OnSummarySectionRender.
Actually I realized while debugging that if i set e.rtc.initial_filter = "test" after the initial grid it changes within the function but it goes back to the initial value "01/01/2015" OnSummarySectionRender. It makes me think the e object rtc properties are static and final or something.
Any ideas? here is the OnSummaryRender Code:
Based on reading the document above I believe I should be able to wrap code in if e.ajaxcallbacks = .f. ... end if to have it only run the first time the grid is initialize yet it keeps running on every subsequent search. Maybe I'm misunderstanding the nature of this function.
I have the following code in the OnGridExecuteEvent:
Code:
if e.ajaxCallback = .f. then dim cCurrentYear as c = CYEAR(DATE()) dim cQueryDayMonth as c = "-01-01" dim cShownFilterDayMonth as c = "01/01/" e.tmpl.filter_initial = "p.EstSTADate > {" + cCurrentYear + cQueryDayMonth + "}" e.rtc.initial_filter = cShownFilterDayMonth + cCurrentYear end if
Actually I realized while debugging that if i set e.rtc.initial_filter = "test" after the initial grid it changes within the function but it goes back to the initial value "01/01/2015" OnSummarySectionRender. It makes me think the e object rtc properties are static and final or something.
Any ideas? here is the OnSummaryRender Code:
Code:
cHighlightedRows = getActiveFilter(session.SelectedFilter) e.javascript = "$('summary').innerHTML ='" + mySummarySectionHTML +"';" + cHighlightedRows + \ "$('current-filter').innerHTML = 'Current Filter(s): "+e.rtc.initial_filter +"';" + \ "$('{grid.componentname}.S.STARTDATE').value = '"+e.rtc.initial_filter+"';" + \ "document.getElementById('StartDate').style.fontWeight = '900'; document.getElementById('StartDate').style.color = 'blue';" debug(1) e.javascript = e.javascript + "alert('test');" end function
Comment