Class: QuickEdit

bcdui.widgetNg. QuickEdit

QuickEdit widget provides UI to edit Wrs row

new bcdui.widgetNg.QuickEdit(args)

widgetNg/quickEdit/quickEditPackage.js, line 156
Name Type Description
args object the arguments
Name Type Description
wrsDataProvider bcdui.core.DataProvider The dataProvider with Wrs document
rowId string the rowId to edit, the row with such ID must exist in the document already
targetHtml targetHtmlRef the targetHtml to render UI
columnTypeWidgetRendererMap object optional optional mapping for widget renderers mapped by 'type-name' of Wrs
callbackHandler QuickEdit~callbackHandler optional optional callback handler function. It is recommended to provide a handler to at least handle "DISPOSE" type, otherwise we just hide the widget and clean its targetHtml if user clicks on "close" button.
Examples

HTML container for QuickEdit

<div id="formContainer"></div>

Sample 1: static call

jQuery("#formContainer").bcduiQuickEdit({
  wrsDataProvider  : new bcdui.core.SimpleModel(), // some wrs data
  rowId            : "R1"                          // i.e. first row
});

Sample 2: call edit form from Wrs grid rendering (default/htmlBuilder.xslt rendering)

const targetHtml = jQuery(".grid-rendering");  // element for grid renderer
const wrsModel = new bcdui.core.SimpleModel(); // Wrs data model

// default Wrs rendering
const wrsRendering = new bcdui.core.Renderer({ targetHtml, inputModel:wrsModel });

// attach DOM event to open quickEdit on doubleclick on grid row
targetHtml.on("dblclick", "[bcdrowident]", function(){
  jQuery("<div/>").appendTo(jQuery("#formContainer").empty()) // add DIV wrapper for repetitive rendering
  .bcduiQuickEdit({
    wrsDataProvider  : wrsModel,
    rowId            : jQuery(this).attr("bcdrowident"), // current row identifier
    callbackHandler  : (instance, type, args) => {       // our callback to process callbacks
      if (type == "DISPOSE"){
        wrsRendering.execute(); // refresh rendered grid on disposal of the form
      }
    }
  });
});