• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Edit Grid using Local Data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Edit Grid using Local Data

    I have a grid using Local Data with several row icons..... Is there a way for the backend to know on which row of the grid the icon press occurred? Without local data, the button program was only passed the row that was pressed, now I get the entire grid so I need to know the specific row so I can process accordingly.

    Thanx

  • #2
    The following steps should get what you need.
    • Create an app variable (I named it rowIndex)
    • Execute a script on click of your icon column
    Code:
    var list   = getWidget('customerList'),
        store  = list.getStore(),
        index = store.indexOf(rec);
    
    setAppVar('rowIndex',index+1);    // adding 1 so index is not 0 based
    success();
    • Check the "Execute in parallel" checkbox for your Call RPG Program action
    • The back-end RPG program will now have access to the "rowIndex" app variable. You can now use GetSelectionChar/Num passing in the value from the rowIndex app variable to retrieve the appropriate record.

    Comment


    • #3
      Alternately, if you have any key field(s) on your data you can just make use of Set App Variables.
      • Create app variable(s) to hold the key fields when a row/icon is clicked
      • On click
        • Set App Variables - set the appropriate app variables based on the clicked row
        • Call your RPG program....it will have access to these app variables. Then you could loop through the rows until it matches your app variable key(s).

      Comment

      Working...
      X