I have a web based Grid Component which uses a Search Part, and hides the grid until a search is done.
In the Client Side events for this grid, I have the following Javascript Code for the OnSearchRender event:
"GetLastUpdate" is an X-Basic function set up as an Ajax Callback.
Within this function, I am querying a SQL Database for the last update. I can get this information without a problem, and it is stored into a variable.
I am attempting to set a <span id="lastchange"> in the Search Part title with this update information.
Here's the X-basic Routine:
This all seems to work great when I do a working preview of this component.
However, when I include this component on a webpage that is part of a Tabbed_UI, it does not work.
I know the javascript is being executed, as the alert message pops up. But the content of the <span> does not change in the webpage, however it does change in a working preview of the component.
Can anyone give me a guess as to what might be the issue here?
Thanks!
In the Client Side events for this grid, I have the following Javascript Code for the OnSearchRender event:
Code:
var rowNum = {grid.object}._selectedRow; {grid.Object}.ajaxCallback('S',rowNum,'GetLastUpdate','',''); alert('Search Render');
Within this function, I am querying a SQL Database for the last update. I can get this information without a problem, and it is stored into a variable.
I am attempting to set a <span id="lastchange"> in the Search Part title with this update information.
Here's the X-basic Routine:
Code:
function GetLastUpdate as c (e as p) 'debug(1) DIM cn as SQL::Connection dim flag as l cn.PortableSQLEnabled = .t. flag = cn.open("::Name::Database") if flag = .f. then GetLastUpdate= "alert('Could Not Open SQL Connection')" else dim sqlGetLastUpdate as c dim lastupdate as t dim lastupdateFormat as c sqlGetLastUpdate = "SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update FROM sys.dm_db_index_usage_stats WHERE database_id = DB_ID( 'Database')AND OBJECT_ID=OBJECT_ID('TableName')" flag=cn.Execute(sqlGetLastUpdate) 'Get Date and Time of Last update to SQl Table lastupdate = cn.ResultSet.data(2) lastupdateFormat = time("d Mon yyyy \at h:0m am", lastupdate) cn.close() e._setElement.lastchange.value = ("(Last Updated: "+lastupdateFormat+")") end if end function
However, when I include this component on a webpage that is part of a Tabbed_UI, it does not work.
I know the javascript is being executed, as the alert message pops up. But the content of the <span> does not change in the webpage, however it does change in a working preview of the component.
Can anyone give me a guess as to what might be the issue here?
Thanks!
Comment