cancel
Showing results for 
Search instead for 
Did you mean: 

modify the content of cells in a grid

Former Member
0 Kudos

hello, it is possible to do a thing like this :

when the user double-click in a line of grid the user could modify the content of all cells of that line and then press a button to make that change in database.

regards

Mário

Accepted Solutions (0)

Answers (2)

Answers (2)

sidnooradarsh
Contributor
0 Kudos

Hi Mario,

Refer to the below blog which tells about one of the ways of updating cell info in grid

[http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417700)ID1995661950DB00029807441537869216End?blog=/pub/wlg/8006]

Regards,

Adarsh

Former Member
0 Kudos

Mario,

Yes, it is very much possible. But need to use customized coding here. On Click/DoubleClick on the line of the Grid, capture the details of the row, open a popup which displays the details of the selected/Clicked row in text boxes and change the data . Also use a Button in the popup page which updates the data in DB, closes the PopUp and refreshes the grid.

Regards

Muzammil

Former Member
0 Kudos

hello, you talked about pop-up, i tried with this code but like this appears 7 prompts..it is possible to show only one prompt??


var AreaDesc = prompt("Introduza a nova área:", document.grd_ScrapList.getGridObject().getSelectedCellValue(2));
var ZoneDesc = prompt("Introduza a nova zona:",document.grd_ScrapList.getGridObject().getSelectedCellValue(3));
var Line = prompt("Introduza a nova linha:",document.grd_ScrapList.getGridObject().getSelectedCellValue(4));
var Cell = prompt("Introduza a nova célula:",document.grd_ScrapList.getGridObject().getSelectedCellValue(5));
var ScrapType = prompt("Introduza o novo tipo de sucata:",document.grd_ScrapList.getGridObject().getSelectedCellValue(6));
var TaraDesc = prompt("Introduza o novo tipo de tara",document.grd_ScrapList.getGridObject().getSelectedCellValue(7));
var weight = prompt("Introduza o novo peso:",document.grd_ScrapList.getGridObject().getSelectedCellValue(8));

regards

Mário

sidnooradarsh
Contributor
0 Kudos

Hi Mario,

This is what you can do

Say this is your Grid Applet

 
<APPLET NAME="GridApplet" WIDTH="600" HEIGHT="400" CODE="iGrid" CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>
     <PARAM NAME="QueryTemplate" VALUE="QueryTemplateName">
     <PARAM NAME="DisplayTemplate" VALUE="DisplayTemplateName">
     <PARAM NAME="AllowSelection" VALUE="true">
     <PARAM NAME="SelectionEvent" VALUE="SelectedRow">
</APPLET>

The above applet will allow you to select a row and after selecting a row it will call the Javascript function "SelectedRow"

Javascript code to extract details of selected row


  function SelectedRow(){
        var RowNo = document.GridApplet.getGridObject().getSelectedRow();    // Gives the Row number of Selected row (Say 5th Row is selected)
        var AreaDesc = document.GridApplet.getGridObject().getCellValue(RowNo,2)); // Gives value of cell (5,2)
        var ZoneDesc = document.GridApplet.getGridObject().getCellValue(RowNo,3));  // Gives value of cell (5,3) and so on for other required cells
	var AllValues = "AreaDesc=" + AreaDesc + "&ZoneDesc=" + ZoneDesc+ "";
       window.open("EditScreen.irpt?"+AllValues,"right");}

The selected values will now be available in the child screen, In the child screen you can create some text boxes and fill them with these values and now these values are editable then provide an button for saving the changes once its clicked fetch all the required values from text box then using icommand applet update the DB, close the window and once the control returns to parent screen re-fresh the igrid and you will be able to see updated data in grid.

This is one of the techniques to update grid contents for another similar technique you can refer to the blog by Rupesh which I have mentioned earlier in this thread

Hope this helps!!

Regards,

Adarsh

Former Member
0 Kudos

thanks a lot.. regards

Mário