3 Replies Latest reply on Feb 12, 2017 12:49 AM by John Snyders-Oracle

    Interactive Grid: Update columns of active row with JS

    CMRuepprich

      I would like to update some columns of the currently selected row. Then, after the update, put the IG into edit mode so the user knows to save the changes.

       

      So far I have this, and it works.

       

      var grid        = apex.region("emp").widget().interactiveGrid("getViews","grid");
      var model       = grid.model;
      var selectedRow = grid.view$.grid("getSelection") ;
      var id          = $(selectedRow[0][0]).data('id');
      var record      = model.getRecord(id)
      model.setValue(record,"JOB",'SALESMAN');
      model.setValue(record,"SAL",111);
      

       

      Is there a better way of getting the selected row (rather than using the jQuery selector on line 4)?

       

      How can I put the IG into edit mode via JavaScript?

       

      Thanks!