on 12-04-2007 7:21 PM
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);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ahmad
But I m concerned whether the supervisor can update the selected column by clicking on that column? I mean if he can write directly into the column for comments.This is the required functionality I need to achieve.
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
As I have understood you want to update the database from frontend.You can try alternate frontends(viz Ajax grids, you can get those packages for around $200) for this functionality. Ofcourse, you have to apply some logics to achiee this functionality. But if it is actual requirement, then it is worth it.
Regards,
Musarrat Husain
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.