Hi,
I have a simple form and an Interactive Grid on the same page. The Interactive grid has four columns and one of the columns is a checkbox. Now my requirement is when I select one of the checkbox of the IG the data of other columns corresponding in that row gets filled in the respective item-fields of the form. Also, I want to make sure the user can select only one checkbox at a time i.e. no multi-selection allowed.
I tried using the following code to populate the column values of the IG to the form item-fields.
const model = this.data.model,
records = this.data.selectedRecords;
let Column1= records.map( r => model.getValue( r, "Column_1" ) ),
Column2= records.map( r => model.getValue( r, "Column_2" ) );
Column3= records.map( r => model.getValue( r, "Column_3" ) );
apex.item( "P2_Field_1" ).setValue( Column1[0] );
apex.item( "P2_Field_2" ).setValue( Column2[0] );
apex.item( "P2_Field_3" ).setValue( Column3[0] );
This code populates the column values correctly but the problem is it does it when I click on any cell of the row in the grid but I want it to do so only when the checkbox is ticked, and also, I want to make it so that only one checkbox can be selected.
Apex Version - 23.1
Thanks and Regards,
Rohit