Forum Stats

  • 3,840,101 Users
  • 2,262,567 Discussions
  • 7,901,149 Comments

Discussions

Interactive grid - take selected rows data issue

User_FVLG7
User_FVLG7 Member Posts: 6 Green Ribbon

Hello,

I've got two editable IG on one page and would like to add some buttons that would have an dynamic actions which could take selected rows from those IG and make some changes on database. I've already tried several code samples but non of those give me an option to operate on button action and take data from IG (all of them was working on SelectionChange action in IG). For example:

var i, i_empids = ":", i_empid,
model = this.data.model;
for ( i = 0; i < this.data.selectedRecords.length; i++ ) { 
    i_empid = model.getValue( this.data.selectedRecords[i], "EMPLOYEE_ID");
    i_empids += model.getValue( this.data.selectedRecords[i], "EMPLOYEE_ID") + ":";
}
apex.item( "P9_EMPIDS" ).setValue (i_empids);
apex.item( "P9_CURRENT_EMPID" ).setValue (i_empid);

How can I change "this" command to a declaration of my IG object, so that I would operate on it via button action?

Or maybe there's any other solution that would work for me?