Hi All
I m extracting data from SQL table onto xMII Dashboard using Grid template.I have one column named comments.
I need that the supervisor using the Dashboard can change the comments as required and it should be reflected on the dashboard as well as It is updated in the database.
Can anyone tell me how can I achieve this ? I am concerned whether I would be able to change an xMII Grid row ....
Regards
Amit
Hi Amit,
Add a cell selection event in your iGrid template definition
e.g.
<APPLET NAME="appDashBoard" WIDTH="100%" HEIGHT="250" CODE="iGrid" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
<PARAM NAME="QueryTemplate" VALUE="/your/query/template">
<PARAM NAME="DisplayTemplate" VALUE="/your/display/template">
<PARAM NAME="InitialUpdate" VALUE="true">
<PARAM NAME="CellSelectionEvent" VALUE="JavaScriptFunctionName">
</APPLET>
Create a query template to update new comment in database
<APPLET NAME="appUpdateComment" WIDTH="1" HEIGHT="1" CODE="iCommand" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
<PARAM NAME="QueryTemplate" VALUE="/update/comment">
</APPLET>
In your Java script function check whether the selected cell is part of the comment's column
if (appDashBoard,getSelectedCellColumn() == 'Comment'){
//capture new user comment
var comment = prompt('Enter comment', '');
//get record id from igrid for the selected comment
var cellRow = appDashBoard.getSelectedCellRow();
var rID = getCellValue(cellRow, columNumberOfID);
var appUpdateCommentQry= appUpdateComment.getQueryObject();
appUpdateCommentQry.setParam(1, rID);
appUpdateCommentQry.setParam(2, comment );
if(appUpdateComment.executeCommand()) {
} else {
}
.....
appDashBoard.updateGrid(true);
Add a comment