cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Row in a Grid

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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);

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

No, not possible with xMII. Maybe in the future, but not now.

Former Member
0 Kudos

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