Skip to Content
author's profile photo Former Member
Former Member

Updating Row in a Grid

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 11:06 PM

    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
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:10 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.