Initializing help system before first use

Getting Started with the JavaScript API 4.7

The JavaScript API offers a powerful way to create custom web views for an Xpress Insight application.

With this API you can create attractive, interactive views which present, interact with, and modify the underlying optimization data and control the execution of scenarios.

This reference describes the JavaScript API and should be used as an aid to developing and deploying optimization applications using Xpress Insight.

For an introduction and detailed guidance on writing custom views read the Xpress Insight Developers Guide, Chapter 6.

<xpressdir>\docs\insight\Xpress_Insight_developers_guide.pdf

A comprehensive set of examples are also available that demonstrate how to use the API in practice, found in:

<xpressdir>\examples\insight

A useful starting point in exploring this reference is the insight global object. The UI components such as tables, forms and charts are exposed in the namespace insight.components.

Quick Start

The quick start app at <xpressdir>\examples\insight\quick_start.zip has the following JavaScript code which serves as a good base for your own apps.

insight.ready(function () {
    // Get the Insight View.
    var view = insight.getView();

    // Listen to the selected scenario(s).
    // In this case the first scenario in the view selection is listened to.
    var observer = view.withFirstScenario();

    // Bind the relevant page DOM elements to the Insight Components or to a function.
    // At least one component or function must be bound to the observer.
    // The following shows a simple function being bound to the observer which logs summary data changes to the console.
    observer.withSummaryData()
        .notify(function (scenario) {
            console.log(scenario.getName() + ' summary data has changed');
        });

    // Start listening to the observed scenarios and render the view.
    view.start();
});

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.