Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Address and City columns of the grid can be fully customized, plus name replaced using a custom pluginsplugin. The example code of such a plugin:

Code Block
var SampleCustomer = SampleCustomer || {};
SampleCustomer.Plugins = SampleCustomer.Plugins || {};

SampleCustomer.Plugins.manipulateSearchResults = async function(context) {
    debugger;
    context.customerSearchResults.setColumnHeaders(["foo", "bar"]);
    context.customerSearchResults.setRowData("b41a1595-e321-ec11-b6e6-6045bd8a1d39", "foo", ["bar", "qwe"]);
};

The context parameter of the JS plugin function contains a customerSearchResults property. It is an instance of Enreach.API.customerSearchResults class, which has the following methods:

setColumnHeaders(columnHeaders)

Manipulates the column headers of the grid. Only Address and City columns ca be overridden. Default columns are removed when the method is called.

  • columnHeader: string array of column headers

setRowData(id, name, fieldValues)

Updates the values of a particular item.

  • id: primary key (GUID) of the item

  • name: the value which should be displayed in Name column of the grid

  • fieldValues: array of additional field (string) values to be displayed

The number of columns given to setColumnHeaders and length of fieldValues array have to be identical.